Sequential Quantum Gate Decomposer  v1.9.6
Powerful decomposition of general unitarias into one- and two-qubit gates gates
Macros | Functions
apply_large_kernel_to_input_AVX.cpp File Reference

AVX-optimized implementations for applying multi-qubit gate kernels to quantum state vectors and matrices. More...

#include "apply_large_kernel_to_input_AVX.h"
#include "apply_kernel_to_state_vector_input_AVX.h"
#include <array>
#include "tbb/tbb.h"
#include "omp.h"
Include dependency graph for apply_large_kernel_to_input_AVX.cpp:

Go to the source code of this file.

Macros

#define COMPUTE_3QBIT_ROW(row_letter, base0, base1, base2, base3, base4, base5, base6, base7)
 
#define COMPUTE_3QBIT_ROW_CONSECUTIVE(row_letter, mv00, mv20, mv40, mv60)
 
#define CREATE_MATRIX_VECTOR(base_idx)
 
#define CREATE_MATRIX_VECTOR_CONSECUTIVE(base_idx)
 

Functions

void apply_2qbit_kernel_to_matrix_input_parallel_AVX_OpenMP (Matrix &two_qbit_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply two-qubit gate kernel to an input matrix using AVX optimization and OpenMP parallelization. More...
 
void apply_2qbit_kernel_to_matrix_input_parallel_AVX_OpenMP32 (Matrix_float &two_qbit_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_2qbit_kernel_to_state_vector_input_AVX32_impl (Matrix_float &two_qbit_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_2qbit_kernel_to_state_vector_input_AVX_impl (Matrix &two_qbit_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply two-qubit gate kernel to a state vector using AVX optimization. More...
 
void apply_2qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl (Matrix_float &two_qbit_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_2qbit_kernel_to_state_vector_input_AVX_OpenMP_impl (Matrix &two_qbit_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply two-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization. More...
 
void apply_2qbit_kernel_to_state_vector_input_AVX_TBB32_impl (Matrix_float &two_qbit_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_2qbit_kernel_to_state_vector_input_AVX_TBB_impl (Matrix &two_qbit_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply two-qubit gate kernel to a state vector using AVX optimization and TBB parallelization. More...
 
void apply_3qbit_kernel_to_state_vector_input_AVX32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_3qbit_kernel_to_state_vector_input_AVX_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply a 3-qubit quantum gate (unitary matrix) to a state vector using AVX intrinsics. More...
 
void apply_3qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_3qbit_kernel_to_state_vector_input_AVX_OpenMP_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply three-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization. More...
 
void apply_3qbit_kernel_to_state_vector_input_AVX_TBB32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_3qbit_kernel_to_state_vector_input_AVX_TBB_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply three-qubit gate kernel to a state vector using AVX optimization and TBB parallelization. More...
 
void apply_4qbit_kernel_to_state_vector_input_AVX32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_4qbit_kernel_to_state_vector_input_AVX_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply four-qubit gate kernel to a state vector using AVX optimization. More...
 
void apply_4qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_4qbit_kernel_to_state_vector_input_AVX_OpenMP_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply four-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization. More...
 
void apply_4qbit_kernel_to_state_vector_input_AVX_TBB32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_4qbit_kernel_to_state_vector_input_AVX_TBB_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply four-qubit gate kernel to a state vector using AVX optimization and TBB parallelization. More...
 
void apply_5qbit_kernel_to_state_vector_input_AVX32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_5qbit_kernel_to_state_vector_input_AVX_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply five-qubit gate kernel to a state vector using AVX optimization. More...
 
void apply_5qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_5qbit_kernel_to_state_vector_input_AVX_OpenMP_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply five-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization. More...
 
void apply_5qbit_kernel_to_state_vector_input_AVX_TBB32_impl (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_5qbit_kernel_to_state_vector_input_AVX_TBB_impl (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply five-qubit gate kernel to a state vector using AVX optimization and TBB parallelization. More...
 
void apply_crot_kernel_to_matrix_input_AVX (Matrix &u3_1qbit1, Matrix &u3_1qbit2, Matrix &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 Call to apply crot gate kernel on an input matrix using AVX. More...
 
void apply_crot_kernel_to_matrix_input_AVX32 (Matrix_float &u3_1qbit1, Matrix_float &u3_qbit2, Matrix_float &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
void apply_crot_kernel_to_matrix_input_AVX_parallel (Matrix &u3_1qbit1, Matrix &u3_1qbit2, Matrix &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 Call to apply crot gate kernel on an input matrix using AVX and TBB. More...
 
void apply_crot_kernel_to_matrix_input_AVX_parallel32 (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_AVX (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_AVX32 (Matrix_float &u3_1qbit1, Matrix_float &u3_qbit2, Matrix_float &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
void apply_crot_kernel_to_matrix_input_from_right_AVX_parallel (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_AVX_parallel32 (Matrix_float &u3_1qbit1, Matrix_float &u3_1qbit2, Matrix_float &input, const int &target_qbit, const int &control_qbit, const int &matrix_size)
 
template<int n>
void apply_fixed_qbit_unitary_AVX (Matrix &gate_kernel_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<int n>
void apply_fixed_qbit_unitary_AVX32 (Matrix_float &gate_kernel_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<int n>
void apply_fixed_qbit_unitary_AVX_OpenMP (Matrix &gate_kernel_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<int n>
void apply_fixed_qbit_unitary_AVX_OpenMP32 (Matrix_float &gate_kernel_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<int n>
void apply_fixed_qbit_unitary_AVX_TBB (Matrix &gate_kernel_unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
template<int n>
void apply_fixed_qbit_unitary_AVX_TBB32 (Matrix_float &gate_kernel_unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right_AVX (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right_AVX32 (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right_AVX_OpenMP (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right_AVX_OpenMP32 (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right_AVX_TBB (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_from_right_AVX_TBB32 (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_to_input_AVX (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply multi-qubit gate kernel to an input matrix using AVX optimization. More...
 
void apply_large_kernel_to_input_AVX32 (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_to_input_AVX_OpenMP (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply multi-qubit gate kernel to an input matrix using AVX optimization and OpenMP parallelization. More...
 
void apply_large_kernel_to_input_AVX_OpenMP32 (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
void apply_large_kernel_to_input_AVX_TBB (Matrix &unitary, Matrix &input, std::vector< int > involved_qbits, const int &matrix_size)
 Apply multi-qubit gate kernel to an input matrix using AVX optimization and TBB parallelization. More...
 
void apply_large_kernel_to_input_AVX_TBB32 (Matrix_float &unitary, Matrix_float &input, std::vector< int > involved_qbits, const int &matrix_size)
 
__m256d complex_mult_AVX (__m256d input_vec, __m256d unitary_row_vec, __m256d neg)
 Perform complex multiplication using AVX intrinsics. More...
 
template<int n>
void complex_prod_AVX32_fixed (const __m256 *mv_xy, int rdx, int cdx, const int *indices, const Matrix_float &input, int col, __m256 &result)
 
template<int n>
void complex_prod_AVX_fixed (const __m256d *mv_xy, int rdx, int cdx, const int *indices, const Matrix &input, int col, __m256d &result)
 
__m256d * construct_mv_xy_vectors (const Matrix &gate_kernel_unitary, const int &matrix_size)
 Write the computed block back to the input matrix. More...
 
__m256 * construct_mv_xy_vectors32 (const Matrix_float &gate_kernel_unitary, const int &matrix_size)
 
template<int n>
void construct_mv_xy_vectors32_fixed (const Matrix_float &gate_kernel_unitary, __m256 *mv_xy)
 
template<int n>
void construct_mv_xy_vectors_fixed (const Matrix &gate_kernel_unitary, __m256d *mv_xy)
 
__m256d get_AVX_vector (double *element_outer, double *element_inner)
 Helper function to load and prepare AVX vectors with outer and inner elements for complex multiplication. More...
 
void get_block_indices_fast (int iter_idx, const std::vector< int > &target_qubits, const std::vector< int > &non_targets, const std::vector< int > &block_pattern, std::vector< int > &indices)
 Efficiently compute the indices for a given block using precomputed patterns. More...
 
void precompute_index_mapping (const std::vector< int > &target_qubits, const std::vector< int > &non_targets, std::vector< int > &block_pattern)
 Precompute the index mapping for target and non-target qubits. More...
 

Detailed Description

AVX-optimized implementations for applying multi-qubit gate kernels to quantum state vectors and matrices.

Definition in file apply_large_kernel_to_input_AVX.cpp.

Macro Definition Documentation

◆ COMPUTE_3QBIT_ROW

#define COMPUTE_3QBIT_ROW (   row_letter,
  base0,
  base1,
  base2,
  base3,
  base4,
  base5,
  base6,
  base7 
)

Definition at line 808 of file apply_large_kernel_to_input_AVX.cpp.

◆ COMPUTE_3QBIT_ROW_CONSECUTIVE

#define COMPUTE_3QBIT_ROW_CONSECUTIVE (   row_letter,
  mv00,
  mv20,
  mv40,
  mv60 
)
Value:
__m256d data_real_##row_letter = _mm256_setzero_pd(); \
__m256d data_imag_##row_letter = _mm256_setzero_pd(); \
data_real_##row_letter = _mm256_fmadd_pd(element_000_vec, mv##mv00##0, data_real_##row_letter); \
data_real_##row_letter = _mm256_fmadd_pd(element_010_vec, mv##mv20##0, data_real_##row_letter); \
data_real_##row_letter = _mm256_fmadd_pd(element_100_vec, mv##mv40##0, data_real_##row_letter); \
data_real_##row_letter = _mm256_fmadd_pd(element_110_vec, mv##mv60##0, data_real_##row_letter); \
data_imag_##row_letter = _mm256_fmadd_pd(element_000_vec, mv##mv00##1, data_imag_##row_letter); \
data_imag_##row_letter = _mm256_fmadd_pd(element_010_vec, mv##mv20##1, data_imag_##row_letter); \
data_imag_##row_letter = _mm256_fmadd_pd(element_100_vec, mv##mv40##1, data_imag_##row_letter); \
data_imag_##row_letter = _mm256_fmadd_pd(element_110_vec, mv##mv60##1, data_imag_##row_letter); \
__m256d data_##row_letter = _mm256_hadd_pd(data_real_##row_letter, data_imag_##row_letter ); \
data_##row_letter = _mm256_permute4x64_pd(data_##row_letter, 0b11011000); \
data_##row_letter = _mm256_hadd_pd(data_##row_letter, data_##row_letter); \
__m128d low128##row_letter = _mm256_castpd256_pd128(data_##row_letter); \
__m128d high128##row_letter = _mm256_extractf128_pd(data_##row_letter, 1); \
results[row_idx].real = _mm_cvtsd_f64(low128##row_letter); \
results[row_idx].imag = _mm_cvtsd_f64(high128##row_letter);

Definition at line 783 of file apply_large_kernel_to_input_AVX.cpp.

◆ CREATE_MATRIX_VECTOR

#define CREATE_MATRIX_VECTOR (   base_idx)
Value:
__m256d mv##base_idx##0 = _mm256_set_pd(-unitary[base_idx].imag, unitary[base_idx].real, -unitary[base_idx].imag, unitary[base_idx].real); \
__m256d mv##base_idx##1 = _mm256_set_pd( unitary[base_idx].real, unitary[base_idx].imag, unitary[base_idx].real, unitary[base_idx].imag);

Definition at line 804 of file apply_large_kernel_to_input_AVX.cpp.

◆ CREATE_MATRIX_VECTOR_CONSECUTIVE

#define CREATE_MATRIX_VECTOR_CONSECUTIVE (   base_idx)
Value:
__m256d mv##base_idx##0 = _mm256_set_pd(-unitary[base_idx+1].imag, unitary[base_idx+1].real, -unitary[base_idx].imag, unitary[base_idx].real); \
__m256d mv##base_idx##1 = _mm256_set_pd( unitary[base_idx+1].real, unitary[base_idx+1].imag, unitary[base_idx].real, unitary[base_idx].imag);

Definition at line 779 of file apply_large_kernel_to_input_AVX.cpp.

Function Documentation

◆ apply_2qbit_kernel_to_matrix_input_parallel_AVX_OpenMP()

void apply_2qbit_kernel_to_matrix_input_parallel_AVX_OpenMP ( Matrix two_qbit_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Apply two-qubit gate kernel to an input matrix using AVX optimization and OpenMP parallelization.

Parameters
two_qbit_unitaryThe 4x4 unitary matrix representing the two-qubit gate operation
inputThe input matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (2 qubits)
matrix_sizeThe size of the input matrix (should be a power of 2)

Definition at line 3520 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_2qbit_kernel_to_matrix_input_parallel_AVX_OpenMP32()

void apply_2qbit_kernel_to_matrix_input_parallel_AVX_OpenMP32 ( Matrix_float two_qbit_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5960 of file apply_large_kernel_to_input_AVX.cpp.

◆ apply_2qbit_kernel_to_state_vector_input_AVX32_impl()

void apply_2qbit_kernel_to_state_vector_input_AVX32_impl ( Matrix_float two_qbit_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5948 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_2qbit_kernel_to_state_vector_input_AVX_impl()

void apply_2qbit_kernel_to_state_vector_input_AVX_impl ( Matrix two_qbit_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Apply two-qubit gate kernel to a state vector using AVX optimization.

Parameters
two_qbit_unitaryThe 4x4 unitary matrix representing the two-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (2 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 516 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_2qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl()

void apply_2qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl ( Matrix_float two_qbit_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5952 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_2qbit_kernel_to_state_vector_input_AVX_OpenMP_impl()

void apply_2qbit_kernel_to_state_vector_input_AVX_OpenMP_impl ( Matrix two_qbit_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Apply two-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization.

Parameters
two_qbit_unitaryThe 4x4 unitary matrix representing the two-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (2 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 1553 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_2qbit_kernel_to_state_vector_input_AVX_TBB32_impl()

void apply_2qbit_kernel_to_state_vector_input_AVX_TBB32_impl ( Matrix_float two_qbit_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5956 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_2qbit_kernel_to_state_vector_input_AVX_TBB_impl()

void apply_2qbit_kernel_to_state_vector_input_AVX_TBB_impl ( Matrix two_qbit_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Apply two-qubit gate kernel to a state vector using AVX optimization and TBB parallelization.

Parameters
two_qbit_unitaryThe 4x4 unitary matrix representing the two-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (2 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 1825 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_3qbit_kernel_to_state_vector_input_AVX32_impl()

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

Definition at line 5964 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_3qbit_kernel_to_state_vector_input_AVX_impl()

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

Apply a 3-qubit quantum gate (unitary matrix) to a state vector using AVX intrinsics.

Parameters
unitaryThe 8x8 unitary matrix representing the 3-qubit gate.
inputThe state vector to which the gate is applied.
involved_qbitsA vector of three integers indicating the qubit indices the gate acts on.
matrix_sizeThe size of the state vector (should be a power of 2).

Definition at line 849 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_3qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl()

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

Definition at line 5968 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_3qbit_kernel_to_state_vector_input_AVX_OpenMP_impl()

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

Apply three-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization.

Parameters
unitaryThe 8x8 unitary matrix representing the three-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (3 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 2095 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_3qbit_kernel_to_state_vector_input_AVX_TBB32_impl()

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

Definition at line 5972 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_3qbit_kernel_to_state_vector_input_AVX_TBB_impl()

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

Apply three-qubit gate kernel to a state vector using AVX optimization and TBB parallelization.

Parameters
unitaryThe 8x8 unitary matrix representing the three-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (3 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 2268 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_4qbit_kernel_to_state_vector_input_AVX32_impl()

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

Definition at line 5976 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_4qbit_kernel_to_state_vector_input_AVX_impl()

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

Apply four-qubit gate kernel to a state vector using AVX optimization.

Parameters
unitaryThe 16x16 unitary matrix representing the four-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (4 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 1013 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_4qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl()

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

Definition at line 5980 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_4qbit_kernel_to_state_vector_input_AVX_OpenMP_impl()

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

Apply four-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization.

Parameters
unitaryThe 16x16 unitary matrix representing the four-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (4 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 2443 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_4qbit_kernel_to_state_vector_input_AVX_TBB32_impl()

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

Definition at line 5984 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_4qbit_kernel_to_state_vector_input_AVX_TBB_impl()

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

Apply four-qubit gate kernel to a state vector using AVX optimization and TBB parallelization.

Parameters
unitaryThe 16x16 unitary matrix representing the four-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (4 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 2640 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_5qbit_kernel_to_state_vector_input_AVX32_impl()

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

Definition at line 5988 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_5qbit_kernel_to_state_vector_input_AVX_impl()

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

Apply five-qubit gate kernel to a state vector using AVX optimization.

Parameters
unitaryThe 32x32 unitary matrix representing the five-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (5 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 1216 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_5qbit_kernel_to_state_vector_input_AVX_OpenMP32_impl()

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

Definition at line 5992 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_5qbit_kernel_to_state_vector_input_AVX_OpenMP_impl()

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

Apply five-qubit gate kernel to a state vector using AVX optimization and OpenMP parallelization.

Parameters
unitaryThe 32x32 unitary matrix representing the five-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (5 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 2842 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_5qbit_kernel_to_state_vector_input_AVX_TBB32_impl()

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

Definition at line 5996 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_5qbit_kernel_to_state_vector_input_AVX_TBB_impl()

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

Apply five-qubit gate kernel to a state vector using AVX optimization and TBB parallelization.

Parameters
unitaryThe 32x32 unitary matrix representing the five-qubit gate operation
inputThe input state vector matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation (5 qubits)
matrix_sizeThe size of the input state vector (should be a power of 2)

Definition at line 3179 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_crot_kernel_to_matrix_input_AVX()

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

Call to apply crot gate kernel on an input matrix using AVX.

Apply controlled rotation (CROT) kernel to a matrix input using AVX optimization.

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 3617 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_crot_kernel_to_matrix_input_AVX32()

void apply_crot_kernel_to_matrix_input_AVX32 ( Matrix_float u3_1qbit1,
Matrix_float u3_qbit2,
Matrix_float input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 6160 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_crot_kernel_to_matrix_input_AVX_parallel()

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

Call to apply crot gate kernel on an input matrix using AVX and TBB.

Apply controlled rotation (CROT) kernel to a matrix input using AVX optimization and parallel processing.

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 3836 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_crot_kernel_to_matrix_input_AVX_parallel32()

void apply_crot_kernel_to_matrix_input_AVX_parallel32 ( 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 6000 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_crot_kernel_to_matrix_input_from_right_AVX()

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

Definition at line 4089 of file apply_large_kernel_to_input_AVX.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_AVX32()

void apply_crot_kernel_to_matrix_input_from_right_AVX32 ( Matrix_float u3_1qbit1,
Matrix_float u3_qbit2,
Matrix_float input,
const int target_qbit,
const int control_qbit,
const int matrix_size 
)

Definition at line 6203 of file apply_large_kernel_to_input_AVX.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_AVX_parallel()

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

Definition at line 4217 of file apply_large_kernel_to_input_AVX.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_AVX_parallel32()

void apply_crot_kernel_to_matrix_input_from_right_AVX_parallel32 ( 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 6060 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_fixed_qbit_unitary_AVX()

template<int n>
void apply_fixed_qbit_unitary_AVX ( Matrix gate_kernel_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 4527 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_fixed_qbit_unitary_AVX32()

template<int n>
void apply_fixed_qbit_unitary_AVX32 ( Matrix_float gate_kernel_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5743 of file apply_large_kernel_to_input_AVX.cpp.

◆ apply_fixed_qbit_unitary_AVX_OpenMP()

template<int n>
void apply_fixed_qbit_unitary_AVX_OpenMP ( Matrix gate_kernel_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 4595 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ apply_fixed_qbit_unitary_AVX_OpenMP32()

template<int n>
void apply_fixed_qbit_unitary_AVX_OpenMP32 ( Matrix_float gate_kernel_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5810 of file apply_large_kernel_to_input_AVX.cpp.

◆ apply_fixed_qbit_unitary_AVX_TBB()

template<int n>
void apply_fixed_qbit_unitary_AVX_TBB ( Matrix gate_kernel_unitary,
Matrix input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 4665 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_fixed_qbit_unitary_AVX_TBB32()

template<int n>
void apply_fixed_qbit_unitary_AVX_TBB32 ( Matrix_float gate_kernel_unitary,
Matrix_float input,
std::vector< int involved_qbits,
const int matrix_size 
)

Definition at line 5879 of file apply_large_kernel_to_input_AVX.cpp.

◆ apply_large_kernel_from_right_AVX()

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

Definition at line 5568 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_from_right_AVX32()

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

Definition at line 5610 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_from_right_AVX_OpenMP()

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

Definition at line 5582 of file apply_large_kernel_to_input_AVX.cpp.

Here is the call graph for this function:

◆ apply_large_kernel_from_right_AVX_OpenMP32()

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

Definition at line 5624 of file apply_large_kernel_to_input_AVX.cpp.

Here is the call graph for this function:

◆ apply_large_kernel_from_right_AVX_TBB()

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

Definition at line 5596 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_from_right_AVX_TBB32()

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

Definition at line 5638 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_to_input_AVX()

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

Apply multi-qubit gate kernel to an input matrix using AVX optimization.

Parameters
unitaryThe 2^Nx2^N unitary matrix representing the gate operation
inputThe input matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation
matrix_sizeThe size of the input matrix (should be a power of 2)

Definition at line 90 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_to_input_AVX32()

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

Definition at line 4345 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_to_input_AVX_OpenMP()

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

Apply multi-qubit gate kernel to an input matrix using AVX optimization and OpenMP parallelization.

Parameters
unitaryThe 2^Nx2^N unitary matrix representing the gate operation
inputThe input matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation
matrix_sizeThe size of the input matrix (should be a power of 2)

Definition at line 145 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_to_input_AVX_OpenMP32()

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

Definition at line 4389 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_to_input_AVX_TBB()

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

Apply multi-qubit gate kernel to an input matrix using AVX optimization and TBB parallelization.

Parameters
unitaryThe 2^Nx2^N unitary matrix representing the gate operation
inputThe input matrix on which the transformation is applied
involved_qbitsThe qubits involved in the gate operation
matrix_sizeThe size of the input matrix (should be a power of 2)

Definition at line 373 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ apply_large_kernel_to_input_AVX_TBB32()

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

Definition at line 4433 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ complex_mult_AVX()

__m256d complex_mult_AVX ( __m256d  input_vec,
__m256d  unitary_row_vec,
__m256d  neg 
)
inline

Perform complex multiplication using AVX intrinsics.

Parameters
input_vecAVX vector containing the input complex number (real and imaginary parts)
unitary_row_vecAVX vector containing the unitary matrix row element (real and imaginary parts)
negAVX vector containing sign pattern for complex multiplication
Returns
AVX vector containing the result of complex multiplication

Definition at line 62 of file apply_large_kernel_to_input_AVX.cpp.

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

◆ complex_prod_AVX32_fixed()

template<int n>
void complex_prod_AVX32_fixed ( const __m256 *  mv_xy,
int  rdx,
int  cdx,
const int indices,
const Matrix_float input,
int  col,
__m256 &  result 
)
inline

Definition at line 5716 of file apply_large_kernel_to_input_AVX.cpp.

Here is the call graph for this function:

◆ complex_prod_AVX_fixed()

template<int n>
void complex_prod_AVX_fixed ( const __m256d *  mv_xy,
int  rdx,
int  cdx,
const int indices,
const Matrix input,
int  col,
__m256d &  result 
)
inline

Definition at line 4506 of file apply_large_kernel_to_input_AVX.cpp.

Here is the call graph for this function:

◆ construct_mv_xy_vectors()

__m256d* construct_mv_xy_vectors ( const Matrix gate_kernel_unitary,
const int matrix_size 
)
inline

Write the computed block back to the input matrix.

Precompute AVX vectors for the unitary matrix to optimize complex multiplication.

Parameters
inputThe input matrix to be updated
new_block_realThe real parts of the new block
new_block_imagThe imaginary parts of the new block
indicesThe indices where the new block should be written Precompute AVX vectors for the unitary matrix to optimize complex multiplication
gate_kernel_unitaryThe unitary matrix of the gate operation
matrix_sizeThe size of the unitary matrix
Returns
Pointer to the precomputed AVX vectors

Definition at line 481 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ construct_mv_xy_vectors32()

__m256 * construct_mv_xy_vectors32 ( const Matrix_float gate_kernel_unitary,
const int matrix_size 
)
inline

Definition at line 5652 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ construct_mv_xy_vectors32_fixed()

template<int n>
void construct_mv_xy_vectors32_fixed ( const Matrix_float gate_kernel_unitary,
__m256 *  mv_xy 
)
inline

Definition at line 5685 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ construct_mv_xy_vectors_fixed()

template<int n>
void construct_mv_xy_vectors_fixed ( const Matrix gate_kernel_unitary,
__m256d *  mv_xy 
)
inline

Definition at line 4483 of file apply_large_kernel_to_input_AVX.cpp.

◆ get_AVX_vector()

__m256d get_AVX_vector ( double *  element_outer,
double *  element_inner 
)
inline

Helper function to load and prepare AVX vectors with outer and inner elements for complex multiplication.

Parameters
element_outerPointer to the outer element (real and imaginary parts)
element_innerPointer to the inner element (real and imaginary parts)
Returns
Prepared AVX vector for complex multiplication

Definition at line 43 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ get_block_indices_fast()

void get_block_indices_fast ( int  iter_idx,
const std::vector< int > &  target_qubits,
const std::vector< int > &  non_targets,
const std::vector< int > &  block_pattern,
std::vector< int > &  indices 
)
inline

Efficiently compute the indices for a given block using precomputed patterns.

Parameters
iter_idxThe current iteration index
target_qubitsThe qubits involved in the gate operation
non_targetsThe qubits not involved in the gate operation
block_patternThe precomputed index mapping
indicesThe computed indices for the current block

Definition at line 451 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function:

◆ precompute_index_mapping()

void precompute_index_mapping ( const std::vector< int > &  target_qubits,
const std::vector< int > &  non_targets,
std::vector< int > &  block_pattern 
)

Precompute the index mapping for target and non-target qubits.

Parameters
target_qubitsThe qubits involved in the gate operation
non_targetsThe qubits not involved in the gate operation
block_patternThe precomputed index mapping (output parameter)

Definition at line 426 of file apply_large_kernel_to_input_AVX.cpp.

Here is the caller graph for this function: