Functions for applying general one-qubit diagonal matrices, as DiagMatr1.
More...
|
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 | applyMultiControlledDiagMatr1 (Qureg qureg, std::vector< int > controls, int target, DiagMatr1 matr) |
|
void | applyMultiStateControlledDiagMatr1 (Qureg qureg, int *controls, int *states, int numControls, int target, DiagMatr1 matr) |
|
void | applyMultiStateControlledDiagMatr1 (Qureg qureg, std::vector< int > controls, std::vector< int > states, int target, DiagMatr1 matr) |
|
void | multiplyDiagMatr1 (Qureg qureg, int target, DiagMatr1 matr) |
|
Functions for applying general one-qubit diagonal matrices, as DiagMatr1.
◆ applyControlledDiagMatr1()
void applyControlledDiagMatr1 |
( |
Qureg | qureg, |
|
|
int | control, |
|
|
int | target, |
|
|
DiagMatr1 | matr ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 256 of file operations.cpp.
256 {
257
258 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, &control, nullptr, 1, &target, 1, matrix, __func__);
259}
◆ applyDiagMatr1()
- Note
- Documentation for this function or struct is under construction!
Definition at line 251 of file operations.cpp.
251 {
252
253 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, nullptr, nullptr, 0, &target, 1, matrix, __func__);
254}
◆ applyMultiControlledDiagMatr1() [1/2]
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 261 of file operations.cpp.
261 {
262
263 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, nullptr, numControls, &target, 1, matrix, __func__);
264}
Referenced by applyMultiControlledDiagMatr1().
◆ applyMultiControlledDiagMatr1() [2/2]
void applyMultiControlledDiagMatr1 |
( |
Qureg | qureg, |
|
|
std::vector< int > | controls, |
|
|
int | target, |
|
|
DiagMatr1 | matr ) |
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
- Note
- Documentation for this function or struct is under construction!
Definition at line 273 of file operations.cpp.
273 {
274
276}
void applyMultiControlledDiagMatr1(Qureg qureg, int *controls, int numControls, int target, DiagMatr1 matrix)
◆ applyMultiStateControlledDiagMatr1() [1/2]
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 266 of file operations.cpp.
266 {
267
268 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matrix, __func__);
269}
Referenced by applyMultiQubitPhaseFlip(), applyMultiQubitPhaseShift(), applyMultiStateControlledDiagMatr1(), and applyMultiStateControlledPauliZ().
◆ applyMultiStateControlledDiagMatr1() [2/2]
void applyMultiStateControlledDiagMatr1 |
( |
Qureg | qureg, |
|
|
std::vector< int > | controls, |
|
|
std::vector< int > | states, |
|
|
int | target, |
|
|
DiagMatr1 | matr ) |
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
- Note
- Documentation for this function or struct is under construction!
Definition at line 278 of file operations.cpp.
278 {
279 validate_controlsMatchStates(controls.size(), states.size(), __func__);
280
282}
void applyMultiStateControlledDiagMatr1(Qureg qureg, int *controls, int *states, int numControls, int target, DiagMatr1 matrix)
◆ multiplyDiagMatr1()
- Note
- Documentation for this function or struct is under construction!
Definition at line 242 of file operations.cpp.
242 {
243 validate_quregFields(qureg, __func__);
244 validate_target(qureg, target, __func__);
245 validate_matrixFields(matrix, __func__);
246
247 bool conj = false;
248 localiser_statevec_anyCtrlOneTargDiagMatr(qureg, {}, {}, target, matrix, conj);
249}