paddle_quantum.gate.matrix
The library of gate matrices.
- paddle_quantum.gate.matrix.h_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of H gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.s_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of S gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.sdg_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of Sdg gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.t_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of T gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.tdg_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of Sdg gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.x_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of X gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.y_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of Y gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.z_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of Z gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.p_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of P gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.rx_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of R_X gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.ry_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of R_Y gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.rz_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of R_Z gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.u3_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of U_3 gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cnot_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of CNOT gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cy_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of CY gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cz_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of CZ gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.swap_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of SWAP gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cp_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of CP gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.crx_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of CR_X gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cry_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of CR_Y gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.crz_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of CR_Z gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cu_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of CU gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.rxx_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of RXX gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.ryy_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of RYY gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.rzz_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of RZZ gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.ms_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of MS gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.cswap_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of CSWAP gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.toffoli_gate(dtype=None)
Generate the matrix
- Parameters:
dtype (str | None) – the dtype of this matrix. Defaults to
None
.- Returns:
the matrix of Toffoli gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.universal2_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of universal two qubits gate.
- Return type:
Tensor
- paddle_quantum.gate.matrix.universal3_gate(theta)
Generate the matrix
- Parameters:
theta (Tensor) – the parameter of this matrix.
- Returns:
the matrix of universal three qubits gate.
- Return type:
Tensor