Quantum Gate Decomposer  v1.3
Powerful decomposition of almost any unitary into U3 and CNOT gates
python_interface.h
Go to the documentation of this file.
1 /*
2 Created on Fri Jun 26 14:13:26 2020
3 Copyright (C) 2020 Peter Rakyta, Ph.D.
4 
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see http://www.gnu.org/licenses/.
17 
18 @author: Peter Rakyta, Ph.D.
19 */
26 #ifndef python_interface_H
27 #define python_interface_H
28 
29 
30 #include "qgd/Operation.h"
31 
32 
33 extern "C" {
34 
44 void* iface_new_N_Qubit_Decomposition( double* mtx_real, double* mtx_imag, int qbit_num, bool optimize_layer_num, int initial_guess_num );
45 
50 int iface_start_decomposition( void* ptr );
51 
56 int iface_delete_N_Qubit_Decomposition( void* ptr );
57 
64 int iface_set_identical_blocks( void* ptr, int qbit, int identical_blocks );
65 
72 int iface_set_iteration_loops( void* ptr, int qbit, int iteration_loops );
73 
80 int iface_set_max_layer_num( void* ptr, int qbit, int max_layer_num );
81 
87 void iface_list_operations( void* ptr, int start_index );
88 
93 int iface_get_operation_num( void* ptr );
94 
105 int iface_get_operation( void* ptr, int n, int &op_type, int &target_qbit, int &control_qbit, double* parameters );
106 
113 int iface_set_verbose( void* ptr, bool verbose );
114 
121 int iface_set_optimalization_block( void* ptr, int optimalization_block );
122 
123 
124 }
125 
126 
127 
128 
129 
130 
131 
132 #endif
void * iface_new_N_Qubit_Decomposition(double *mtx_real, double *mtx_imag, int qbit_num, bool optimize_layer_num, int initial_guess_num)
Creates an instance of class N_Qubit_Decomposition and return with a void pointer pointing to the cla...
int iface_set_verbose(void *ptr, bool verbose)
Call to set the verbosity of the N_Qubit_Decomposition class.
void iface_list_operations(void *ptr, int start_index)
Call to list the operations giving the decomposition of the unitary.
int iface_set_identical_blocks(void *ptr, int qbit, int identical_blocks)
Set the number of identical successive blocks during the subdecomposition of the qbit-th qubit.
Header file for a class for the representation of one- and two-qubit operations.
int iface_get_operation(void *ptr, int n, int &op_type, int &target_qbit, int &control_qbit, double *parameters)
Call to get the n-th optimized operation.
int iface_set_iteration_loops(void *ptr, int qbit, int iteration_loops)
Set the number of iteration loops during the subdecomposition of the qbit-th qubit.
int iface_get_operation_num(void *ptr)
Call to get the number of decomposing operations.
int iface_start_decomposition(void *ptr)
Starts the decomposition of the unitary.
int iface_set_max_layer_num(void *ptr, int qbit, int max_layer_num)
Set the maximal number of layers used in the subdecomposition of the qbit-th qubit.
int qbit_num
Definition: example.py:38
int iface_delete_N_Qubit_Decomposition(void *ptr)
Call to deallocate the N_Qubit_Decomposition class.
int iface_set_optimalization_block(void *ptr, int optimalization_block)
Call to set the number of blocks to be optimized in one shot.