Euler¶
graphqomb.euler module¶
Euler angles and related functions.
This module provides:
euler_decomposition: Decompose a 2x2 unitary matrix into Euler angles.bloch_sphere_coordinates: Get the Bloch sphere coordinates corresponding to a vector.LocalUnitary: Class to represent a local unitary.LocalClifford: Class to represent a local Clifford.meas_basis_info: Return the measurement plane and angle corresponding to a vector.update_lc_lc: Update aLocalCliffordobject with anotherLocalCliffordobject.update_lc_basis: Update aLocalCliffordobject with a MeasBasis object.
Local Operators¶
- class graphqomb.euler.LocalUnitary[source]¶
Bases:
objectClass to represent signle-qubit unitaries.
\(U(\alpha, \beta, \gamma) = R_z(\gamma)R_x(\beta)R_z(\alpha)\)
- conjugate()[source]¶
Return the conjugate of the
LocalUnitaryobject.- Returns:
conjugate
LocalUnitary- Return type:
- class graphqomb.euler.LocalClifford[source]¶
Bases:
LocalUnitaryClass to represent a local Clifford.
\(U(\alpha, \beta, \gamma) = R_z(\gamma)R_x(\beta)R_z(\alpha)\) Each angle must be integer multiples of \(\pi/2\).
- alpha¶
angle for the first \(R_z\). The angle must be a multiple of \(\pi/2\), by default 0
- Type:
- gamma¶
angle for the last \(R_z\). The angle must be a multiple of \(\pi/2\), by default 0
- Type:
- conjugate()[source]¶
Return the conjugate of the
LocalCliffordobject.- Returns:
conjugate
LocalClifford- Return type:
Functions¶
- graphqomb.euler.euler_decomposition(u)[source]¶
Decompose a 2x2 unitary matrix into Euler angles.
\(U \rightarrow R_z(\gamma)R_x(\beta)R_z(\alpha)\)
- Parameters:
u (
numpy.typing.NDArray[numpy.complex128]) – unitary 2x2 matrix- Returns:
euler angles (\(\alpha\), \(\beta\), \(\gamma\))
- Return type:
- graphqomb.euler.bloch_sphere_coordinates(vector)[source]¶
Get the Bloch sphere coordinates corresponding to a vector.
\(|\psi\rangle = \cos(\theta/2)|0\rangle + \exp(i\phi)\sin(\theta/2)|1\rangle\)
- Parameters:
vector (
numpy.typing.NDArray[numpy.complex128]) – 1 qubit state vector- Returns:
Bloch sphere coordinates (\(\theta\), \(\phi\))
- Return type:
- graphqomb.euler.meas_basis_info(vector)[source]¶
Return the measurement plane and angle corresponding to a vector.
- Parameters:
vector (
numpy.typing.NDArray[numpy.complex128]) – 1 qubit state vector- Returns:
measurement plane and angle
- Return type:
- Raises:
ValueError – if the vector does not lie on any of 3 planes
- graphqomb.euler.update_lc_lc(lc1, lc2)[source]¶
Update a
LocalCliffordobject with anotherLocalCliffordobject.- Parameters:
lc1 (
LocalClifford) – leftLocalCliffordlc2 (
LocalClifford) – rightLocalClifford
- Returns:
multiplied
LocalClifford- Return type:
- graphqomb.euler.update_lc_basis(lc, basis)[source]¶
Update a
MeasBasisobject with an action ofLocalCliffordobject.- Parameters:
lc (
LocalClifford) –LocalClifford
- Returns:
updated
PlannerMeasBasis- Return type: