Sequential Quantum Gate Decomposer  v1.9.3
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Functions
N_Qubit_Decomposition_Cost_Function.cpp File Reference

Methods to calculate the cost function of the final optimization problem (supporting parallel computations). More...

#include "N_Qubit_Decomposition_Cost_Function.h"
Include dependency graph for N_Qubit_Decomposition_Cost_Function.cpp:

Go to the source code of this file.

Functions

double get_cost_function (Matrix matrix, int trace_offset)
 Call co calculate the cost function during the final optimization process. More...
 
double get_cost_function_sum_of_squares (Matrix &matrix)
 
Matrix_real get_cost_function_with_correction (Matrix matrix, int qbit_num, int trace_offset)
 Call co calculate the cost function of the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf. More...
 
Matrix_real get_cost_function_with_correction2 (Matrix matrix, int qbit_num, int trace_offset)
 Call co calculate the cost function of the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf. More...
 
double get_hilbert_schmidt_test (Matrix &matrix)
 Call co calculate the cost function of the optimization process according to https://arxiv.org/pdf/2210.09191.pdf. More...
 
double get_infidelity (Matrix &matrix)
 Call to calculate infidelity. More...
 
QGD_Complex16 get_trace (Matrix &matrix)
 Call to calculate the real and imaginary parts of the trace. More...
 
Matrix get_trace_with_correction (Matrix &matrix, int qbit_num)
 Call co calculate the Hilbert Schmidt testof the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf. More...
 
Matrix get_trace_with_correction2 (Matrix &matrix, int qbit_num)
 Call co calculate the Hilbert Schmidt testof the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf. More...
 

Detailed Description

Methods to calculate the cost function of the final optimization problem (supporting parallel computations).

Definition in file N_Qubit_Decomposition_Cost_Function.cpp.

Function Documentation

◆ get_cost_function()

double get_cost_function ( Matrix  matrix,
int  trace_offset 
)

Call co calculate the cost function during the final optimization process.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
trace_offsetThe offset in the first columns from which the "trace" is calculated. In this case Tr(A) = sum_(i-offset=j) A_{ij}
Returns
Returns with the calculated cost function.

Definition at line 34 of file N_Qubit_Decomposition_Cost_Function.cpp.

Here is the caller graph for this function:

◆ get_cost_function_sum_of_squares()

double get_cost_function_sum_of_squares ( Matrix matrix)

Definition at line 316 of file N_Qubit_Decomposition_Cost_Function.cpp.

Here is the caller graph for this function:

◆ get_cost_function_with_correction()

Matrix_real get_cost_function_with_correction ( Matrix  matrix,
int  qbit_num,
int  trace_offset 
)

Call co calculate the cost function of the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
qbit_numThe number of qubits
Returns
Returns with the matrix containing the cost function (index 0) and the first correction (index 1).

Definition at line 133 of file N_Qubit_Decomposition_Cost_Function.cpp.

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

◆ get_cost_function_with_correction2()

Matrix_real get_cost_function_with_correction2 ( Matrix  matrix,
int  qbit_num,
int  trace_offset 
)

Call co calculate the cost function of the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
qbit_numThe number of qubits
Returns
Returns with the matrix containing the cost function (index 0), the first correction (index 1) and the second correction (index 2).

Definition at line 205 of file N_Qubit_Decomposition_Cost_Function.cpp.

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

◆ get_hilbert_schmidt_test()

double get_hilbert_schmidt_test ( Matrix matrix)

Call co calculate the cost function of the optimization process according to https://arxiv.org/pdf/2210.09191.pdf.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
qbit_numThe number of qubits
Returns
Returns the cost function

Definition at line 362 of file N_Qubit_Decomposition_Cost_Function.cpp.

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

◆ get_infidelity()

double get_infidelity ( Matrix matrix)

Call to calculate infidelity.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
qbit_numThe number of qubits
Returns
Returns the cost function

Definition at line 372 of file N_Qubit_Decomposition_Cost_Function.cpp.

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

◆ get_trace()

QGD_Complex16 get_trace ( Matrix matrix)

Call to calculate the real and imaginary parts of the trace.

Parameters
matrixThe square shaped complex matrix from which the trace is calculated.
Returns
Returns with the calculated trace.

Definition at line 337 of file N_Qubit_Decomposition_Cost_Function.cpp.

Here is the caller graph for this function:

◆ get_trace_with_correction()

Matrix get_trace_with_correction ( Matrix matrix,
int  qbit_num 
)

Call co calculate the Hilbert Schmidt testof the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
qbit_numThe number of qubits
Returns
Returns with the matrix containing the cost function (index 0-1) and the first correction (index 2-3).

Definition at line 388 of file N_Qubit_Decomposition_Cost_Function.cpp.

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

◆ get_trace_with_correction2()

Matrix get_trace_with_correction2 ( Matrix matrix,
int  qbit_num 
)

Call co calculate the Hilbert Schmidt testof the optimization process, and the first correction to the cost finction according to https://arxiv.org/pdf/2210.09191.pdf.

Parameters
matrixThe square shaped complex matrix from which the cost function is calculated.
qbit_numThe number of qubits
Returns
Returns with the matrix containing the cost function (index 0-1), the first correction (index 2-3) and the second correction (index 4-5).

Definition at line 428 of file N_Qubit_Decomposition_Cost_Function.cpp.

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