![]() |
The Quantum Exact Simulation Toolkit v4.3.0
|
Functions for overwriting the elements of channels. More...
Functions | |
| void | setInlineKrausMap (KrausMap map, int numQb, int numOps, {{{ matrices }}}) |
| void | setInlineSuperOp (SuperOp op, int numQb, {{ matrix }}) |
| void | setKrausMap (KrausMap map, qcomp ***matrices) |
| void | setKrausMap (KrausMap map, qcomp matrices[map.numMatrices][map.numRows][map.numRows]) |
| void | setSuperOp (SuperOp op, qcomp **matrix) |
| void | setSuperOp (SuperOp op, qcomp matrix[op.numRows][op.numRows]) |
Functions for overwriting the elements of channels.
| void setInlineKrausMap | ( | KrausMap | map, |
| int | numQb, | ||
| int | numOps, | ||
| {{{ matrices }}} | ) |
Overwrites the Kraus operators of map from an inline literal.
The {{{matrices}}} argument is a 3D array literal, of dimensions numOps by 1<<numQb by 1<<numQb.
C, this is a macro, where numQb and numOps must be compile-time literals, and turn {{{matrices}}} into a compound literal.C++, this is a function which accepts {{{matrices}}} as a nested std::vector literal.| [in,out] | map | the KrausMap to overwrite. |
| [in] | numQb | the number of qubits of the literal {{{matrices}}}. |
| [in] | numOps | the number of Kraus operators of the literal {{{matrices}}}. |
| error |
|
| void setInlineSuperOp | ( | SuperOp | op, |
| int | numQb, | ||
| {{ matrix }} | ) |
Overwrites the elements of op from an inline literal.
The {{matrix}} argument is a 2D array literal, of dimensions 1<<(2*numQb) by 1<<(2*numQb).
C, this is a macro, where numQb must be a compile-time literal, amd turns {{matrix}} into a compound literal.C++, this is a function which accepts {{matrix}} as a nested std::vector literal.| [in,out] | op | the SuperOp to overwrite. |
| [in] | numQb | the number of qubits of the {{matrix}} literal. |
| error |
|
| void setKrausMap | ( | KrausMap | map, |
| qcomp *** | matrices ) |
Overwrites the Kraus operators of map.
Argument matrices must be a list of KrausMap::numMatrices matrices, each of dimension KrausMap::numRows by KrausMap::numRows.
This updates KrausMap::matrices and other internal properties.
| [in,out] | map | the KrausMap to overwrite. |
| [in] | matrices | a 3D nested list of the above dimensions. |
| error |
|
| seg-fault |
|
Definition at line 309 of file channels.cpp.
Referenced by TEST_CASE(), TEST_CASE(), and TEST_CASE().
| void setKrausMap | ( | KrausMap | map, |
| qcomp | matrices[map.numMatrices][map.numRows][map.numRows] ) |
Overwrites the Kraus operators of map from a C array.
This is a C convenience macro equivalent to setKrausMap().
| [in,out] | map | the KrausMap to overwrite. |
| [in] | matrices | a 3D array. |
| error |
|
| void setSuperOp | ( | SuperOp | op, |
| qcomp ** | matrix ) |
Overwrites the elements of op.
This copies matrix into SuperOp::cpuElems and synchronises op to GPU memory when relevant.
| [in,out] | op | the SuperOp to overwrite. |
| [in] | matrix | a SuperOp::numRows by SuperOp::numRows matrix of new elements. |
| error |
|
Definition at line 271 of file channels.cpp.
Referenced by TEST_CASE(), and TEST_CASE().
| void setSuperOp | ( | SuperOp | op, |
| qcomp | matrix[op.numRows][op.numRows] ) |
Overwrites the elements of op from a C array.
This is a C convenience macro equivalent to setSuperOp().
| [in,out] | op | the SuperOp to overwrite. |
| [in] | matrix | a SuperOp::numRows by SuperOp::numRows array. |
| error |
|