PhyslibSearch

QuantumInfo.Finite.Qubit.Basic

34 declarations

abbrev

The index set for a qubit basis (Fin 2\text{Fin } 2)

#Qubit

The type `Qubit` is defined as the set of indices {0,1}\{0, 1\}, represented by the finite type Fin 2\text{Fin } 2. In the context of quantum information, this serves as the index set for the computational basis states of a two-level south-system (a qubit).

definition

Tactic for expanding and simplifying small matrix equalities

#matrix_expand

`matrix_expand` is a tactic designed to prove equalities between small matrices. It operates by expanding matrix products into their individual entries and then simplifying the resulting expressions using standard real-number arithmetic. The tactic optionally accepts a list of simplification lemmas (via `[...]`) and a pattern for case-splitting/recursion (via `with ...`).

definition

Pauli ZZ gate σz\sigma_z

#Z

The Pauli ZZ gate is a unitary operator σz\sigma_z acting on the Hilbert space of a single qubit, represented in the computational basis by the 2×22 \times 2 matrix: σz=(1001) \sigma_z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix} This operator maps the basis state 0\ket{0} to 0\ket{0} and the basis state 1\ket{1} to 1-\ket{1}.

definition

Pauli XX gate σx\sigma_x

#X

The Pauli XX gate is a unitary operator σx\sigma_x acting on the Hilbert space of a single qubit, represented in the computational basis by the 2×22 \times 2 matrix: σx=(0110) \sigma_x = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} This operator performs a bit-flip, mapping the basis state 0\ket{0} to 1\ket{1} and the basis state 1\ket{1} to 0\ket{0}.

definition

Pauli YY gate σy\sigma_y

#Y

The Pauli YY gate is a unitary operator acting on the Hilbert space of a qubit, represented in the computational basis by the 2×22 \times 2 matrix: σy=(0ii0) \sigma_y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix} where ii is the imaginary unit.

definition

Hadamard gate HH for a qubit

#H

The Hadamard gate HH is a unitary operator acting on the Hilbert space of a qubit. In the computational basis {0,1}\{|0\rangle, |1\rangle\} (indexed by `Qubit`), it is represented by the matrix: H=12(1111) H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}

definition

The SS gate (or π/2\pi/2 phase gate) for a qubit

#S

The SS gate (also known as the Phase gate) is a unitary operator acting on the Hilbert space of a single qubit. In the computational basis {0,1}\{|0\rangle, |1\rangle\}, it is represented by the 2×22 \times 2 matrix: S=(100i) S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix} where ii is the imaginary unit. This operator corresponds to a rotation about the zz-axis of the Bloch sphere by an angle of π/2\pi/2, i.e., Rz(π/2)R_z(\pi/2) (up to a global phase).

definition

The TT gate (or π/4\pi/4 phase gate) for a qubit

#T

The TT gate is a unitary operator on a single qubit, defined by the matrix T=(1001+i2)T = \begin{pmatrix} 1 & 0 \\ 0 & \frac{1+i}{\sqrt{2}} \end{pmatrix} This corresponds to a rotation about the zz-axis of the Bloch sphere by an angle of π/4\pi/4, i.e., Rz(π/4)R_z(\pi/4) (up to a global phase).

theorem

Z2=IZ^2 = I

#Z_sq

The square of the Pauli ZZ operator is equal to the identity operator, i.e., Z2=IZ^2 = I.

theorem

X2=IX^2 = I

#X_sq

For the single-qubit Pauli-XX gate, the square of the operator is equal to the identity operator, i.e., X2=IX^2 = I.

theorem

Y2=1Y^2 = 1

#Y_sq

The square of the Pauli YY gate σy\sigma_y is equal to the identity operator 1\mathbb{1} on the qubit Hilbert space, meaning σyσy=1\sigma_y \sigma_y = \mathbb{1}.

theorem

H2=IH^2 = I

#H_sq

The square of the Hadamard gate HH is equal to the identity operator II on the qubit Hilbert space, i.e., H2=IH^2 = I.

theorem

S2=ZS^2 = Z

#S_sq

The square of the SS gate (phase gate) is equal to the Pauli ZZ gate, expressed as S2=ZS^2 = Z, where SS and ZZ are unitary operators acting on the single-qubit Hilbert space.

theorem

T2=ST^2 = S

#T_sq

In the context of qubit operations, the square of the TT gate is equal to the SS gate (T2=ST^2 = S). Here, TT and SS denote the standard single-qubit phase gates.

theorem

Anticommutation of Pauli XX and YY gates

#X_Y_anticomm

The Pauli XX and YY gates anticommute, satisfying the relation XY=YXXY = -YX.

theorem

ZY=YZZY = -YZ

#Y_Z_anticomm

Let YY and ZZ be the Pauli-YY and Pauli-ZZ gates acting on the Hilbert space of a qubit. These operators satisfy the anticommutation relation ZY=YZZY = -YZ.

theorem

ZX=XZZX = -XZ

#Z_X_anticomm

Let ZZ and XX be the Pauli-ZZ and Pauli-XX gates acting on the Hilbert space of a qubit. These operators satisfy the anticommutation relation ZX=XZZX = -XZ, or equivalently, the anticommutator {Z,X}=ZX+XZ\{Z, X\} = ZX + XZ is zero.

theorem

HX=ZHHX = ZH

#H_mul_X_eq_Z_mul_H

Let HH, XX, and ZZ be the Hadamard gate, the Pauli-XX gate, and the Pauli-ZZ gate acting on a qubit, respectively. Then the following operator identity holds: HX=ZHH X = Z H

theorem

HZ=XHHZ = XH

#H_mul_Z_eq_X_mul_H

Let HH, ZZ, and XX be the Hadamard gate, the Pauli-ZZ gate, and the Pauli-XX gate acting on a qubit, respectively. Then the following operator identity holds: HZ=XHH Z = X H

theorem

The qubit phase gate SS and Pauli-ZZ gate commute (ZS=SZZS = SZ)

#S_Z_comm

Let SS be the phase gate and ZZ be the Pauli-ZZ gate acting on a qubit. Then these operators commute, satisfying the identity: ZS=SZZ S = S Z

theorem

ZZ and TT Gates Commute

#T_Z_comm

The single-qubit phase gate TT and the Pauli ZZ gate commute, such that ZT=TZZ T = T Z.

theorem

SS and TT gates commute

#S_T_comm

For the single-qubit gates SS and TT, the commutation relation ST=TSS T = T S holds.

definition

Controllized Unitary Operator C(U)C(U)

#controllize

Given a Hilbert space Hk\mathcal{H}_k and a unitary operator UU(Hk)U \in \text{U}(\mathcal{H}_k), the controllized version of UU is a unitary operator acting on the space C2Hk\mathbb{C}^2 \otimes \mathcal{H}_k (represented as Qubit×k\text{Qubit} \times k). The operator acts as the identity on the subspace corresponding to the qubit state 0|0\rangle and applies UU on the subspace corresponding to the qubit state 1|1\rangle. Formally, its matrix elements are defined as: \[ (C(U))_{(q_1, t_1), (q_2, t_2)} = \begin{cases} \delta_{t_1, t_2} & \text{if } q_1 = q_2 = 0 \\ U_{t_1, t_2} & \text{if } q_1 = q_2 = 1 \\ 0 & \text{otherwise} \end{cases} \] where q1,q2{0,1}q_1, q_2 \in \{0, 1\} are the control qubit indices and t1,t2t_1, t_2 are indices in the target space kk.

definition

Notation C[g]C[g] for the controllization of gate gg

#termC[_]

For a given quantum gate or unitary operator gg acting on a kk-qubit system, C[g]C[g] denotes the controlled version of that gate, which is a unitary operator acting on a system of 1+k1 + k qubits (the control qubit and the original kk qubits).

definition

The Controlled-NOT (CNOT) gate on two qubits

#CNOT

The Controlled-NOT gate, denoted as CNOT\text{CNOT}, is a unitary operator acting on a two-qubit system represented by the space C2C2\mathbb{C}^2 \otimes \mathbb{C}^2 (coordinated here as Fin 2×Fin 2\text{Fin } 2 \times \text{Fin } 2). It is defined by applying the Pauli-XX gate (the quantum NOT gate) to the target qubit if and only if the control qubit is in the state 1|1\rangle. Formally, it is the result of the `controllize` operation applied to the single-qubit gate XX.

theorem

Matrix Representation of CNOT Gate

#CNOT_matrix

The matrix representation of the CNOT (Controlled-NOT) gate, acting on the product space of two qubits and reindexed using the standard equivalence Fin 2×Fin 2Fin 4\text{Fin } 2 \times \text{Fin } 2 \simeq \text{Fin } 4, is given by the 4×44 \times 4 permutation matrix: (1000010000010010) \begin{pmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{pmatrix} where the entries are complex numbers C\mathbb{C}.

theorem

Matrix Elements of C[g]C[g] for Control Qbit 0|0\rangle are Identity Elements

#controllize_apply_zero_zero

Let gg be a unitary operator U[k]\mathbf{U}[k] acting on a kk-dimensional Hilbert space. Let C[g]C[g] denote the controlled version of gg, which is a unitary operator acting on the product space of a qubit and the kk-dimensional space, C2k\mathbb{C}^2 \otimes k. For any indices j1,j2j_1, j_2 in the kk-dimensional space, the matrix element of the controlled gate C[g]C[g] corresponding to the control qubit being in state 0|0\rangle is given by: \[ (C[g])_{(0, j_1), (0, j_2)} = I_{j_1, j_2} \] where II is the identity operator in U[k]\mathbf{U}[k]. This reflects that when the control qubit is 0|0\rangle, the operation applied to the target system is the identity.

theorem

The matrix element of a controlled gate C[g]C[g] is 00 when the control qubit's state transitions from 1|1\rangle to 0|0\rangle.

#controllize_apply_zero_one

Let gg be a unitary operator acting on a system kk (denoted as gU[k]g \in \mathbf{U}[k]), and let C[g]C[g] denote the controlled version of gg where a qubit acts as the control. For any indices j1,j2j_1, j_2 in the state space of kk, the matrix element of the controlled operator C[g]C[g] corresponding to the transition from the control qubit being in state 1|1\rangle and system kk being in state j2|j_2\rangle to the control qubit being in state 0|0\rangle and system kk being in state j1|j_1\rangle is zero. In other words, (C[g])(0,j1),(1,j2)=0(C[g])_{(0, j_1), (1, j_2)} = 0.

theorem

The matrix elements of C[g]C[g] for control qubit transitions 01|0\rangle \to |1\rangle and 10|1\rangle \to |0\rangle are zero.

#controllize_apply_one_zero

Let gg be a unitary operator acting on a kk-dimensional quantum system, denoted by U[k]\mathbf{U}[k]. Let C[g]C[g] denote the controlled version of gg, acting on the composite system of a control qubit and the kk-dimensional target system, where the qubit states are indexed by {0,1}\{0, 1\}. For any indices j1,j2j_1, j_2 of the target system, the matrix element of the controlled operator C[g]C[g] corresponding to the control qubit being in state 1|1\rangle and transitioning to 0|0\rangle is zero. That is, 1,j1C[g]0,j2=0\langle 1, j_1 | C[g] | 0, j_2 \rangle = 0.

theorem

The matrix element of C[g]C[g] with control qubit at 1|1\rangle is gj1,j2g_{j_1, j_2}

#controllize_apply_one_one

Let gg be a unitary operator acting on a kk-qubit system, and let C[g]C[g] denote its controlled version acting on a (1+k)(1+k)-qubit system where the first qubit is the control. For any basis states j1|j_1\rangle and j2|j_2\rangle of the kk-qubit target system, if the control qubit is in state 1|1\rangle, the matrix elements of the controlled gate satisfy: (C[g])(1,j1),(1,j2)=gj1,j2(C[g])_{(1, j_1), (1, j_2)} = g_{j_1, j_2} where 11 denotes the state of the control qubit being "on".

theorem

C[g1]C[g2]=C[g1g2]C[g_1] \cdot C[g_2] = C[g_1 \cdot g_2]

#controllize_mul

Let g1,g2U[k]g_1, g_2 \in \mathbf{U}[k] be two unitary operators acting on a kk-qubit system. Let C[g]C[g] denote the controllization of a unitary operator gg, which is a unitary operator on the combined system of a control qubit and the kk-qubit target. Then the product of the controllized operators is the controllization of the product of the operators, i.e., C[g1]C[g2]=C[g1g2]C[g_1] \cdot C[g_2] = C[g_1 \cdot g_2].

theorem

The controllization of the identity gate is the identity gate: C[1]=1C[1] = 1

#controllize_one

For any unitary operator 11 acting on a kk-qubit system, its controlled version C[1]C[1] acting on the combined system of a control qubit and the kk-qubit target is equal to the identity operator 11 on the combined system. Use C[g]C[g] to denote the controllization of a gate gg, and U[k]\mathbf{U}[k] to denote the space of unitary operators on kk qubits.

theorem

C[g]C[g1]=1C[g] \cdot C[g^{-1}] = 1

#controllize_mul_inv

Let gg be a unitary operator acting on a kk-qubit system, and let C[g]C[g] denote the controllized version of gg, acting on the composite space of a control qubit and the kk-qubit target. The product of the controllized operator C[g]C[g] and the controllized version of its inverse C[g1]C[g^{-1}] is the identity operator 11 on the combined system.

theorem

Conjugation of Controlled gg by XIX \otimes I equals (Ig)C[g1](I \otimes g) C[g^{-1}]

#X_controllize_X

Let XX be the Pauli-X gate acting on a qubit, and let gg be a unitary operator on a kk-qubit system. Let C[g]C[g] denote the controlled version of gg, where the first qubit acts as the control and the kk-qubit system is the target. Then the following identity holds: (XI)C[g](XI)=(Ig)C[g1](X \otimes I) C[g] (X \otimes I) = (I \otimes g) C[g^{-1}] where II denotes the identity operator and \otimes denotes the tensor product of operators.