Functions for initialising Qureg into physical states.
More...
Functions for initialising Qureg into physical states.
◆ initArbitraryPureState()
void initArbitraryPureState |
( |
Qureg | qureg, |
|
|
qcomp * | amps ) |
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 99 of file initialisations.cpp.
99 {
100 validate_quregFields(qureg, __func__);
101
102
103 (qureg.isDensityMatrix)?
104 localiser_densmatr_initArbitraryPureState(qureg, amps):
105 localiser_statevec_initArbitraryPureState(qureg, amps);
106}
Referenced by TEST_CASE(), and TEST_CASE().
◆ initBlankState()
void initBlankState |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 41 of file initialisations.cpp.
41 {
42 validate_quregFields(qureg, __func__);
43
44
45 qcomp amp = 0;
46 localiser_statevec_initUniformState(qureg, amp);
47}
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
◆ initClassicalState()
void initClassicalState |
( |
Qureg | qureg, |
|
|
qindex | stateInd ) |
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 80 of file initialisations.cpp.
80 {
81 validate_quregFields(qureg, __func__);
82 validate_basisStateIndex(qureg, ind, __func__);
83
84
85 if (qureg.isDensityMatrix)
86 ind = util_getGlobalFlatIndex(qureg, ind, ind);
87
88 localiser_statevec_initClassicalState(qureg, ind);
89}
Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().
◆ initDebugState()
void initDebugState |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 92 of file initialisations.cpp.
92 {
93 validate_quregFields(qureg, __func__);
94
95 localiser_statevec_initDebugState(qureg);
96}
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().
◆ initPlusState()
void initPlusState |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 59 of file initialisations.cpp.
59 {
60 validate_quregFields(qureg, __func__);
61
62
63
64 qcomp amp = 1.0 / std::sqrt(qureg.numAmps);
65 localiser_statevec_initUniformState(qureg, amp);
66}
Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().
◆ initPureState()
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
- Warning
- This function has not yet been unit tested and may contain bugs. Please use with caution!
Definition at line 69 of file initialisations.cpp.
69 {
70 validate_quregFields(qureg, __func__);
71 validate_quregFields(pure, __func__);
72 validate_quregCanBeInitialisedToPureState(qureg, pure, __func__);
73
74 (qureg.isDensityMatrix)?
75 localiser_densmatr_initPureState(qureg, pure):
76 localiser_statevec_setQuregToClone(qureg, pure);
77}
Referenced by TEST_CASE().
◆ initRandomMixedState()
void initRandomMixedState |
( |
Qureg | qureg, |
|
|
qindex | numPureStates ) |
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 132 of file initialisations.cpp.
132 {
133 validate_quregFields(qureg, __func__);
134 validate_quregIsDensityMatrix(qureg, __func__);
135 validate_numInitRandomPureStates(numPureStates, __func__);
136
137 localiser_densmatr_initMixtureOfUniformlyRandomPureStates(qureg, numPureStates);
138}
Referenced by TEST_CASE().
◆ initRandomPureState()
void initRandomPureState |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 117 of file initialisations.cpp.
117 {
118 validate_quregFields(qureg, __func__);
119
120
121
122
123 if (qureg.isDensityMatrix)
124 localiser_densmatr_initUniformlyRandomPureStateAmps(qureg);
125 else {
126 localiser_statevec_initUnnormalisedUniformlyRandomPureStateAmps(qureg);
128 }
129}
qreal setQuregToRenormalized(Qureg qureg)
Referenced by TEST_CASE().
◆ initZeroState()
void initZeroState |
( |
Qureg | qureg | ) |
|
- Note
- Documentation for this function or struct is under construction!
- Attention
- This function's input validation has not yet been unit tested, so erroneous usage may produce unexpected output. Please use with caution!
Definition at line 50 of file initialisations.cpp.
50 {
51 validate_quregFields(qureg, __func__);
52
53
54 qindex ind = 0;
55 localiser_statevec_initClassicalState(qureg, ind);
56}
Referenced by TEST_CASE(), TEST_CASE(), TEST_CASE(), and TEST_CASE().