Functions for applying the one-qubit S, T and Hadamard gates.
More...
|
| void | applyControlledHadamard (Qureg qureg, int control, int target) |
| |
| void | applyControlledS (Qureg qureg, int control, int target) |
| |
| void | applyControlledT (Qureg qureg, int control, int target) |
| |
| void | applyHadamard (Qureg qureg, int target) |
| |
| void | applyMultiControlledHadamard (Qureg qureg, int *controls, int numControls, int target) |
| |
| void | applyMultiControlledS (Qureg qureg, int *controls, int numControls, int target) |
| |
| void | applyMultiControlledT (Qureg qureg, int *controls, int numControls, int target) |
| |
| void | applyMultiStateControlledHadamard (Qureg qureg, int *controls, int *states, int numControls, int target) |
| |
| void | applyMultiStateControlledS (Qureg qureg, int *controls, int *states, int numControls, int target) |
| |
| void | applyMultiStateControlledT (Qureg qureg, int *controls, int *states, int numControls, int target) |
| |
| void | applyS (Qureg qureg, int target) |
| |
| void | applyT (Qureg qureg, int target) |
| |
Functions for applying the one-qubit S, T and Hadamard gates.
◆ applyControlledHadamard()
| void applyControlledHadamard |
( |
Qureg | qureg, |
|
|
int | control, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 605 of file operations.cpp.
605 {
606 validate_quregFields(qureg, __func__);
607 validate_controlAndTarget(qureg, control, target, __func__);
608
609
611}
void applyMultiStateControlledHadamard(Qureg qureg, int *controls, int *states, int numControls, int target)
◆ applyControlledS()
| void applyControlledS |
( |
Qureg | qureg, |
|
|
int | control, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 503 of file operations.cpp.
503 {
504 validate_quregFields(qureg, __func__);
505 validate_controlAndTarget(qureg, control, target, __func__);
506
507
509}
void applyMultiStateControlledS(Qureg qureg, int *controls, int *states, int numControls, int target)
◆ applyControlledT()
| void applyControlledT |
( |
Qureg | qureg, |
|
|
int | control, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 554 of file operations.cpp.
554 {
555 validate_quregFields(qureg, __func__);
556 validate_controlAndTarget(qureg, control, target, __func__);
557
558
560}
void applyMultiStateControlledT(Qureg qureg, int *controls, int *states, int numControls, int target)
◆ applyHadamard()
| void applyHadamard |
( |
Qureg | qureg, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 597 of file operations.cpp.
597 {
598 validate_quregFields(qureg, __func__);
599 validate_target(qureg, target, __func__);
600
601
603}
Referenced by applyQuantumFourierTransform().
◆ applyMultiControlledHadamard()
| void applyMultiControlledHadamard |
( |
Qureg | qureg, |
|
|
int * | controls, |
|
|
int | numControls, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 613 of file operations.cpp.
613 {
614 validate_quregFields(qureg, __func__);
615 validate_controlsAndTarget(qureg, controls, numControls, target, __func__);
616
617
619}
Referenced by applyMultiControlledHadamard().
◆ applyMultiControlledS()
| void applyMultiControlledS |
( |
Qureg | qureg, |
|
|
int * | controls, |
|
|
int | numControls, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 511 of file operations.cpp.
511 {
512 validate_quregFields(qureg, __func__);
513 validate_controlsAndTarget(qureg, controls, numControls, target, __func__);
514
515
517}
Referenced by applyMultiControlledS().
◆ applyMultiControlledT()
| void applyMultiControlledT |
( |
Qureg | qureg, |
|
|
int * | controls, |
|
|
int | numControls, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 562 of file operations.cpp.
562 {
563 validate_quregFields(qureg, __func__);
564 validate_controlsAndTarget(qureg, controls, numControls, target, __func__);
565
566
568}
Referenced by applyMultiControlledT().
◆ applyMultiStateControlledHadamard()
| void applyMultiStateControlledHadamard |
( |
Qureg | qureg, |
|
|
int * | controls, |
|
|
int * | states, |
|
|
int | numControls, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
- See also
- applyMultiStateControlledCompMatr1()
Definition at line 621 of file operations.cpp.
621 {
622
623 qcomp a = 1/std::sqrt(2);
625 {a, a},
626 {a,-a}});
627
628 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matr, __func__);
629}
static CompMatr1 getCompMatr1(qcomp **in)
Referenced by applyControlledHadamard(), applyHadamard(), applyMultiControlledHadamard(), and applyMultiStateControlledHadamard().
◆ applyMultiStateControlledS()
| void applyMultiStateControlledS |
( |
Qureg | qureg, |
|
|
int * | controls, |
|
|
int * | states, |
|
|
int | numControls, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
- See also
- applyMultiStateControlledCompMatr1()
Definition at line 519 of file operations.cpp.
519 {
520
522 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matr, __func__);
523}
static DiagMatr1 getDiagMatr1(qcomp *in)
Referenced by applyControlledS(), applyMultiControlledS(), applyMultiStateControlledS(), and applyS().
◆ applyMultiStateControlledT()
| void applyMultiStateControlledT |
( |
Qureg | qureg, |
|
|
int * | controls, |
|
|
int * | states, |
|
|
int | numControls, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
- See also
- applyMultiStateControlledCompMatr1()
Definition at line 570 of file operations.cpp.
570 {
571
573 validateAndApplyAnyCtrlAnyTargUnitaryMatrix(qureg, controls, states, numControls, &target, 1, matr, __func__);
574}
Referenced by applyControlledT(), applyMultiControlledT(), applyMultiStateControlledT(), and applyT().
◆ applyS()
| void applyS |
( |
Qureg | qureg, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 495 of file operations.cpp.
495 {
496 validate_quregFields(qureg, __func__);
497 validate_target(qureg, target, __func__);
498
499
501}
◆ applyT()
| void applyT |
( |
Qureg | qureg, |
|
|
int | target ) |
- Note
- Documentation for this function or struct is under construction!
Definition at line 546 of file operations.cpp.
546 {
547 validate_quregFields(qureg, __func__);
548 validate_target(qureg, target, __func__);
549
550
552}