Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Typedefs | Functions
apply_large_kernel_to_input.cpp File Reference
#include "apply_large_kernel_to_input.h"
#include "apply_kernel_to_state_vector_input.h"
#include "tbb/tbb.h"
#include <algorithm>
#include <array>
#include <type_traits>
#include <utility>
Include dependency graph for apply_large_kernel_to_input.cpp:

Go to the source code of this file.

Typedefs

template<typename MatrixT >
using KernelLargeComplexT = typename std::remove_reference< decltype(std::declval< MatrixT & >()[0])>::type
 

Functions

void apply_2qbit_kernel_to_matrix_input (Matrix &two_qbit_unitary, Matrix &input, const int &inner_qbit, const int &outer_qbit, const int &matrix_size)
 
void apply_2qbit_kernel_to_matrix_input (Matrix_float &two_qbit_unitary, Matrix_float &input, const int &inner_qbit, const int &outer_qbit, const int &matrix_size)
 
void apply_2qbit_kernel_to_matrix_input_from_right (Matrix &two_qbit_unitary, Matrix &input, const int &inner_qbit, const int &outer_qbit, const int &matrix_size)
 
void apply_2qbit_kernel_to_matrix_input_from_right (Matrix_float &two_qbit_unitary, Matrix_float &input, const int &inner_qbit, const int &outer_qbit, const int &matrix_size)
 
template<typename MatrixT >
void apply_2qbit_kernel_to_matrix_input_from_right_impl (MatrixT &two_qbit_unitary, MatrixT &input, const int &inner_qbit, const int &outer_qbit, const int &matrix_size)
 
template<typename MatrixT >
void apply_2qbit_kernel_to_matrix_input_impl (MatrixT &two_qbit_unitary, MatrixT &input, const int &inner_qbit, const int &outer_qbit, const int &matrix_size)
 Call to apply a two-qubit gate kernel on an input matrix. More...
 
void apply_crot_kernel_to_matrix_input (Matrix &u3_1qbit1, Matrix &u3_1qbit2, Matrix &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
void apply_crot_kernel_to_matrix_input (Matrix_float &u3_1qbit1, Matrix_float &u3_1qbit2, Matrix_float &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
void apply_crot_kernel_to_matrix_input_from_right (Matrix &u3_1qbit1, Matrix &u3_1qbit2, Matrix &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
void apply_crot_kernel_to_matrix_input_from_right (Matrix_float &u3_1qbit1, Matrix_float &u3_1qbit2, Matrix_float &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
template<typename MatrixT >
void apply_crot_kernel_to_matrix_input_from_right_impl (MatrixT &u3_1qbit1, MatrixT &u3_1qbit2, MatrixT &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
template<typename MatrixT >
void apply_crot_kernel_to_matrix_input_impl (MatrixT &u3_1qbit1, MatrixT &u3_1qbit2, MatrixT &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 Call to apply crot gate kernel on an input matrix. More...
 
void apply_large_kernel_from_right (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<typename MatrixT >
void apply_large_kernel_from_right_impl (MatrixT &unitary, MatrixT &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_to_input (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_to_input (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<typename MatrixT >
void apply_large_kernel_to_input_impl (MatrixT &unitary, MatrixT &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<typename MatrixT >
void apply_nqbit_kernel_to_matrix_input_from_right_impl (MatrixT &unitary, MatrixT &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<typename MatrixT >
void apply_nqbit_kernel_to_matrix_input_impl (MatrixT &unitary, MatrixT &input, std::vector< int > involved_qbits, const int &matrix_size)
 
int get_grain_size (int index_step)
 
template<typename MatrixT >
MatrixT transpose_local_kernel_impl (const MatrixT &unitary)
 

Typedef Documentation

◆ KernelLargeComplexT

template<typename MatrixT >
using KernelLargeComplexT = typename std::remove_reference<decltype(std::declval<MatrixT&>()[0])>::type

Definition at line 33 of file apply_large_kernel_to_input.cpp.

Function Documentation

◆ apply_2qbit_kernel_to_matrix_input() [1/2]

void apply_2qbit_kernel_to_matrix_input ( Matrix two_qbit_unitary,
Matrix input,
const int inner_qbit,
const int outer_qbit,
const int matrix_size 
)

Definition at line 590 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_2qbit_kernel_to_matrix_input() [2/2]

void apply_2qbit_kernel_to_matrix_input ( Matrix_float two_qbit_unitary,
Matrix_float input,
const int inner_qbit,
const int outer_qbit,
const int matrix_size 
)

Definition at line 594 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_2qbit_kernel_to_matrix_input_from_right() [1/2]

void apply_2qbit_kernel_to_matrix_input_from_right ( Matrix two_qbit_unitary,
Matrix input,
const int inner_qbit,
const int outer_qbit,
const int matrix_size 
)

Definition at line 598 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_2qbit_kernel_to_matrix_input_from_right() [2/2]

void apply_2qbit_kernel_to_matrix_input_from_right ( Matrix_float two_qbit_unitary,
Matrix_float input,
const int inner_qbit,
const int outer_qbit,
const int matrix_size 
)

Definition at line 602 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_2qbit_kernel_to_matrix_input_from_right_impl()

template<typename MatrixT >
void apply_2qbit_kernel_to_matrix_input_from_right_impl ( MatrixT &  two_qbit_unitary,
MatrixT &  input,
const int inner_qbit,
const int outer_qbit,
const int matrix_size 
)

Definition at line 367 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_2qbit_kernel_to_matrix_input_impl()

template<typename MatrixT >
void apply_2qbit_kernel_to_matrix_input_impl ( MatrixT &  two_qbit_unitary,
MatrixT &  input,
const int inner_qbit,
const int outer_qbit,
const int matrix_size 
)

Call to apply a two-qubit gate kernel on an input matrix.

Parameters
two_qbit_unitaryThe 4x4 kernel of the gate operation
inputThe input matrix on which the transformation is applied
inner_qbitThe lower significance qubit (little endian convention)
outer_qbitThe higher significance qubit (little endian convention)
matrix_sizeThe size of the input

Definition at line 312 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_crot_kernel_to_matrix_input() [1/2]

void apply_crot_kernel_to_matrix_input ( Matrix u3_1qbit1,
Matrix u3_1qbit2,
Matrix input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 555 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_crot_kernel_to_matrix_input() [2/2]

void apply_crot_kernel_to_matrix_input ( Matrix_float u3_1qbit1,
Matrix_float u3_1qbit2,
Matrix_float input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 560 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_crot_kernel_to_matrix_input_from_right() [1/2]

void apply_crot_kernel_to_matrix_input_from_right ( Matrix u3_1qbit1,
Matrix u3_1qbit2,
Matrix input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 565 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_crot_kernel_to_matrix_input_from_right() [2/2]

void apply_crot_kernel_to_matrix_input_from_right ( Matrix_float u3_1qbit1,
Matrix_float u3_1qbit2,
Matrix_float input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 570 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_crot_kernel_to_matrix_input_from_right_impl()

template<typename MatrixT >
void apply_crot_kernel_to_matrix_input_from_right_impl ( MatrixT &  u3_1qbit1,
MatrixT &  u3_1qbit2,
MatrixT &  input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 511 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_crot_kernel_to_matrix_input_impl()

template<typename MatrixT >
void apply_crot_kernel_to_matrix_input_impl ( MatrixT &  u3_1qbit1,
MatrixT &  u3_1qbit2,
MatrixT &  input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Call to apply crot gate kernel on an input matrix.

Parameters
u3_1qbit1The 2x2 kernel to be applied on target |1>
u3_1qbit2The 2x2 kernel to be applied on target |0>
inputThe input matrix on which the transformation is applied
target_qbitThe target qubit
control_qbitThe control qubit
matrix_sizeThe size of the input

Definition at line 436 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_large_kernel_from_right() [1/2]

void apply_large_kernel_from_right ( Matrix unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 582 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_large_kernel_from_right() [2/2]

void apply_large_kernel_from_right ( Matrix_float unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 586 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_large_kernel_from_right_impl()

template<typename MatrixT >
void apply_large_kernel_from_right_impl ( MatrixT &  unitary,
MatrixT &  input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 105 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_large_kernel_to_input() [1/2]

void apply_large_kernel_to_input ( Matrix unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 574 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_large_kernel_to_input() [2/2]

void apply_large_kernel_to_input ( Matrix_float unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 578 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:

◆ apply_large_kernel_to_input_impl()

template<typename MatrixT >
void apply_large_kernel_to_input_impl ( MatrixT &  unitary,
MatrixT &  input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 82 of file apply_large_kernel_to_input.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ apply_nqbit_kernel_to_matrix_input_from_right_impl()

template<typename MatrixT >
void apply_nqbit_kernel_to_matrix_input_from_right_impl ( MatrixT &  unitary,
MatrixT &  input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 217 of file apply_large_kernel_to_input.cpp.

Here is the caller graph for this function:

◆ apply_nqbit_kernel_to_matrix_input_impl()

template<typename MatrixT >
void apply_nqbit_kernel_to_matrix_input_impl ( MatrixT &  unitary,
MatrixT &  input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 124 of file apply_large_kernel_to_input.cpp.

Here is the caller graph for this function:

◆ get_grain_size()

int get_grain_size ( int  index_step)

Definition at line 60 of file apply_large_kernel_to_input.cpp.

◆ transpose_local_kernel_impl()

template<typename MatrixT >
MatrixT transpose_local_kernel_impl ( const MatrixT &  unitary)

Definition at line 71 of file apply_large_kernel_to_input.cpp.