unitary_set
¶
Post Processing - Classical Shadow - Unitary Set
(qurry.process.classical_shadow.unitary_set
)
The followings are unitary operators for our classical shadow implementation.
And the set of unitary operators \(U_M\) will represent by following dictionary.:
\(R_X(\frac{\pi}{2})\)
\(R_Y(-\frac{\pi}{2})\)
\(R_Z(0) = \mathbb{I}\)
- qurry.process.classical_shadow.unitary_set.IDENTITY: ndarray[tuple[int, ...], dtype[int32]] = array([[1, 0], [0, 1]])¶
The
NDArray[np.int32]
objects for the identity matrix.It’s just \(\mathbb{I} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}\).
What a simple matrix!
- qurry.process.classical_shadow.unitary_set.OUTER_PRODUCT: dict[str, ndarray[tuple[int, ...], dtype[int32]]] = {'0': array([[1, 0], [0, 0]]), '1': array([[0, 0], [0, 1]])}¶
The
NDArray[np.int32]
objects for the outer product of \(|0\rangle\) and \(|1\rangle\).\[\begin{split}|0\rangle\langle0| = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} |1\rangle\langle1| = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}\end{split}\]The set of outer product will represent by following dictionary.:
{ "0": :math:`|0\rangle\langle0|`, "1": :math:`|1\rangle\langle1|` }
- qurry.process.classical_shadow.unitary_set.PRECOMPUTED_RHO_M_K_I = {(0, '0'): array([[0.5+0.j , 0. -1.5j], [0. +1.5j, 0.5+0.j ]]), (0, '1'): array([[0.5+0.j , 0. +1.5j], [0. -1.5j, 0.5+0.j ]]), (1, '0'): array([[0.5, 1.5], [1.5, 0.5]]), (1, '1'): array([[ 0.5, -1.5], [-1.5, 0.5]]), (2, '0'): array([[ 2., 0.], [ 0., -1.]]), (2, '1'): array([[-1., 0.], [ 0., 2.]])}¶
Precomputed \(\rho_{mki}\) matrix.
Note
This is suggested by GitHub Copilot with Claude 3.7 Sonnet Thinking, which I never thought of.
- qurry.process.classical_shadow.unitary_set.PRECOMPUTED_RHO_M_K_I_2 = {0: array([[0.5+0.j , 0. -1.5j], [0. +1.5j, 0.5+0.j ]]), 1: array([[0.5+0.j , 0. +1.5j], [0. -1.5j, 0.5+0.j ]]), 10: array([[0.5, 1.5], [1.5, 0.5]]), 11: array([[ 0.5, -1.5], [-1.5, 0.5]]), 20: array([[ 2., 0.], [ 0., -1.]]), 21: array([[-1., 0.], [ 0., 2.]])}¶
Precomputed \(\rho_{mki}\) matrix.
But use the integer as the key.
- qurry.process.classical_shadow.unitary_set.U_M_GATES: dict[Literal[0, 1, 2] | int, Gate] = {0: Instruction(name='rx', num_qubits=1, num_clbits=0, params=[1.5707963267948966]), 1: Instruction(name='ry', num_qubits=1, num_clbits=0, params=[-1.5707963267948966]), 2: Instruction(name='rz', num_qubits=1, num_clbits=0, params=[0])}¶
The
qiskit.circuit.library.Gate
objects for the unitary operators \(U_M\) in the classical shadow.The set of unitary operators \(U_M\) will represent by following dictionary.:
{ 0: :math:`R_X(\frac{\pi}{2})`, 1: :math:`R_Y(-\frac{\pi}{2})`, 2: :math:`R_Z(0) = \mathbb{I}` }
- qurry.process.classical_shadow.unitary_set.U_M_MATRIX: dict[Literal[0, 1, 2] | int, ndarray[tuple[int, ...], dtype[complex128]]] = {0: array([[0.70710678+0.j , 0. -0.70710678j], [0. -0.70710678j, 0.70710678+0.j ]]), 1: array([[ 0.70710678, 0.70710678], [-0.70710678, 0.70710678]]), 2: array([[1., 0.], [0., 1.]])}¶
The
NDArray[np.complex128]
objects for the unitary operators \(U_M\) in the classical shadow.The set of unitary operators \(U_M\) will represent by following dictionary.:
{ 0: :math:`R_X(\frac{\pi}{2})`, 1: :math:`R_Y(-\frac{\pi}{2})`, 2: :math:`R_Z(0) = \mathbb{I}` }