paddle_quantum.gate.multi_qubit_gate
The source file of the classes for multi-qubit gates.
- class paddle_quantum.gate.multi_qubit_gate.CNOT(qubits_idx=None, num_qubits=None, depth=1, cnot_idx=None)
Bases:
GateA collection of CNOT gates.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.cnot_idx (List[int] | None) – CNOT gate index. Defaults to
None.
- class paddle_quantum.gate.multi_qubit_gate.CY(qubits_idx=None, num_qubits=None, depth=1)
Bases:
GateA collection of controlled Y gates.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.
- class paddle_quantum.gate.multi_qubit_gate.CZ(qubits_idx=None, num_qubits=None, depth=1)
Bases:
GateA collection of controlled Z gates.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.
- class paddle_quantum.gate.multi_qubit_gate.SWAP(qubits_idx=None, num_qubits=None, depth=1)
Bases:
GateA collection of SWAP gates.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.
- class paddle_quantum.gate.multi_qubit_gate.CP(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of controlled P gates.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.CRX(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of controlled rotation gates about the x-axis.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.CRY(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of controlled rotation gates about the y-axis.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.CRZ(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of controlled rotation gates about the z-axis.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.CU(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of controlled single-qubit rotation gates.
For a 2-qubit quantum circuit, when
qubits_idxis[0, 1], the matrix form of such a gate is:- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.RXX(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of RXX gates.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.RYY(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of RYY gates.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.RZZ(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of RZZ gates.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.MS(qubits_idx=None, num_qubits=None, depth=1)
Bases:
GateA collection of Mølmer-Sørensen (MS) gates for trapped ion devices.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.
- class paddle_quantum.gate.multi_qubit_gate.CSWAP(qubits_idx=None, num_qubits=None, depth=1)
Bases:
GateA collection of CSWAP (Fredkin) gates.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.
- class paddle_quantum.gate.multi_qubit_gate.CCX(qubits_idx=None, num_qubits=None, depth=1)
Bases:
GateA collection of CCX (Toffoli) gates.
The matrix form of such a gate is:
- Parameters:
qubits_idx (Iterable | int | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.
- class paddle_quantum.gate.multi_qubit_gate.UniversalTwoQubits(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of universal two-qubit gates. One of such a gate requires 15 parameters.
- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.
- class paddle_quantum.gate.multi_qubit_gate.UniversalThreeQubits(qubits_idx=None, num_qubits=None, depth=1, param=None, param_sharing=False)
Bases:
ParamGateA collection of universal three-qubit gates. One of such a gate requires 81 parameters.
- Parameters:
qubits_idx (Iterable | str | None) – Indices of the qubits on which the gates are applied. Defaults to
'cycle'.num_qubits (int | None) – Total number of qubits. Defaults to
None.depth (int | None) – Number of layers. Defaults to
1.param (Tensor | float | None) – Parameters of the gates. Defaults to
None.param_sharing (bool | None) – Whether gates in the same layer share a parameter. Defaults to
False.
- Raises:
ValueError – The
parammust bepaddle.Tensororfloat.