![]() |
The Quantum Exact Simulation Toolkit v4.2.0
|
Functions for pre- or post-multiplying general one-qubit dense matrices (as CompMatr1) upon density matrices. More...
Functions | |
void | leftapplyCompMatr1 (Qureg qureg, int target, CompMatr1 matrix) |
void | rightapplyCompMatr1 (Qureg qureg, int target, CompMatr1 matrix) |
Functions for pre- or post-multiplying general one-qubit dense matrices (as CompMatr1) upon density matrices.
Multiplies a general one-qubit dense matrix
upon the specified target
qubit of qureg
.
matrix
and \( t = \) target
, and notate \(\hat{M}_t\) as per applyCompMatr1(). Unlike applyCompMatr1() however, this function only ever left-multiplies matrix
upon qureg
, regardless of whether it is a statevector or density matrix.Explicitly,
qureg
is a statevector \( \svpsi \), this function effects \[ \svpsi \rightarrow \hat{M}_t \, \svpsi. \]
qureg
is a density matrix \(\dmrho\), this function effects \[ \dmrho \rightarrow \hat{M}_t \, \dmrho. \]
There are no additional constraints like unitarity.
[in,out] | qureg | the state to modify. |
[in] | target | the index of the target qubit. |
[in] | matrix | the Z-basis matrix to multiply upon the left. |
error |
|
Definition at line 31 of file multiplication.cpp.
Multiplies a general one-qubit dense matrix
upon the specified target
qubit of the density matrix qureg
, from the right-hand side.
qureg
, \( \hat{M} = \) matrix
and \( t = \) target
, and notate \(\hat{M}_t\) as per applyCompMatr1(). Unlike applyCompMatr1() however, this function only ever right-multiplies matrix
upon qureg
.Explicitly
\[ \dmrho \rightarrow \dmrho \, \hat{M}_t \]
where \( \hat{M} \) is not conjugated nor transposed, and there are no additional constraints like unitarity.
In general, this function will break the normalisation of qureg
and result in a non-physical state, and is useful for preparing sub-expressions of formulae like the Linbladian.
[in,out] | qureg | the state to modify. |
[in] | target | the index of the target qubit. |
[in] | matrix | the Z-basis matrix to post-multiply. |
error |
|
Definition at line 41 of file multiplication.cpp.