The Quantum Exact Simulation Toolkit v4.0.0
Loading...
Searching...
No Matches

Functions for applying general one-qubit diagonal matrices, as DiagMatr1. More...

Functions

void applyControlledDiagMatr1 (Qureg qureg, int control, int target, DiagMatr1 matr)
 
void applyDiagMatr1 (Qureg qureg, int target, DiagMatr1 matr)
 
void applyMultiControlledDiagMatr1 (Qureg qureg, int *controls, int numControls, int target, DiagMatr1 matr)
 
void applyMultiStateControlledDiagMatr1 (Qureg qureg, int *controls, int *states, int numControls, int target, DiagMatr1 matr)
 
void multiplyDiagMatr1 (Qureg qureg, int target, DiagMatr1 matr)
 

Detailed Description

Functions for applying general one-qubit diagonal matrices, as DiagMatr1.

Function Documentation

◆ applyControlledDiagMatr1()

void applyControlledDiagMatr1 ( Qureg qureg,
int control,
int target,
DiagMatr1 matr )
Note
Documentation for this function or struct is under construction!

Definition at line 202 of file operations.cpp.

202 {
203
204 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, &target, 1, matrix, __func__);
205}

◆ applyDiagMatr1()

void applyDiagMatr1 ( Qureg qureg,
int target,
DiagMatr1 matr )
Note
Documentation for this function or struct is under construction!

Definition at line 197 of file operations.cpp.

197 {
198
199 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, &target, 1, matrix, __func__);
200}

◆ applyMultiControlledDiagMatr1()

void applyMultiControlledDiagMatr1 ( Qureg qureg,
int * controls,
int numControls,
int target,
DiagMatr1 matr )
Note
Documentation for this function or struct is under construction!

Definition at line 207 of file operations.cpp.

207 {
208
209 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, &target, 1, matrix, __func__);
210}

◆ applyMultiStateControlledDiagMatr1()

void applyMultiStateControlledDiagMatr1 ( Qureg qureg,
int * controls,
int * states,
int numControls,
int target,
DiagMatr1 matr )
Note
Documentation for this function or struct is under construction!

Definition at line 212 of file operations.cpp.

212 {
213
214 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matrix, __func__);
215}

Referenced by applyMultiQubitPhaseFlip(), applyMultiQubitPhaseShift(), and applyMultiStateControlledPauliZ().

◆ multiplyDiagMatr1()

void multiplyDiagMatr1 ( Qureg qureg,
int target,
DiagMatr1 matr )
Note
Documentation for this function or struct is under construction!

Definition at line 188 of file operations.cpp.

188 {
189 validate_quregFields(qureg, __func__);
190 validate_target(qureg, target, __func__);
191 validate_matrixFields(matrix, __func__); // matrix can be non-unitary
192
193 bool conj = false;
194 localiser_statevec_anyCtrlOneTargDiagMatr(qureg, {}, {}, target, matrix, conj);
195}