![]() |
QPanda3
Supported by OriginQ
|
Classes | |
| class | CBit |
| class | CPUQVM |
| class | DAGNode |
| class | DAGQCircuit |
| class | DensityMatrixSimulator |
| class | Encode |
| class | GateType |
| class | GPUQVM |
| class | MeasureNode |
| class | NoiseModel |
| class | NoiseOpType |
| class | Operation |
| class | OpType |
| class | PartialAmplitudeQVM |
| class | PIC_TYPE |
| class | QCircuit |
| class | QElseif |
| class | QElseifThen |
| class | QGate |
| class | QIf |
| class | QIfThen |
| class | QProg |
| class | QResult |
| class | QuantumError |
| class | Qubit |
| class | QWhile |
| class | Stabilizer |
| class | StabilizerResult |
| class | VQGate |
Functions | |
| QGate | BARRIER (list[int] qubits) |
| BARRIER(qubits: list[int]) -> core.QGate. | |
| QGate | CNOT (int qubit1, int qubit2) |
| CNOT(qubit1: int, qubit2: int) -> core.QGate. | |
| QGate | CP (int control, int target, float theta) |
| CP(*args, **kwargs) Overloaded function. | |
| VQGate | CP (int control_qbit_idx, int target_qbit_idx, param) |
| CP(*args, **kwargs) Overloaded function. | |
| QGate | CR (int control, int target, float theta) |
| CR(*args, **kwargs) Overloaded function. | |
| VQGate | CR (int control_qbit_idx, int target_qbit_idx, param) |
| CR(*args, **kwargs) Overloaded function. | |
| QGate | CRX (int control, int target, float theta) |
| CRX(*args, **kwargs) Overloaded function. | |
| VQGate | CRX (int control_qbit_idx, int target_qbit_idx, param) |
| CRX(*args, **kwargs) Overloaded function. | |
| QGate | CRY (int control, int target, float theta) |
| CRY(*args, **kwargs) Overloaded function. | |
| VQGate | CRY (int control_qbit_idx, int target_qbit_idx, param) |
| CRY(*args, **kwargs) Overloaded function. | |
| QGate | CRZ (int control, int target, float theta) |
| CRZ(*args, **kwargs) Overloaded function. | |
| VQGate | CRZ (int control_qbit_idx, int target_qbit_idx, param) |
| CRZ(*args, **kwargs) Overloaded function. | |
| QGate | CU (int control, int target, float theta, float phi, float _lambda, float gamma) |
| CU(*args, **kwargs) Overloaded function. | |
| VQGate | CU (int control_qbit_idx, int target_qbit_idx, param1, param2, param3, param4) |
| CU(*args, **kwargs) Overloaded function. | |
| VQGate | CU (int control_qbit_idx, int target_qbit_idx, float param1, param2, param3, param4) |
| CU(*args, **kwargs) Overloaded function. | |
| VQGate | CU (int control_qbit_idx, int target_qbit_idx, float param1, float param2, param3, param4) |
| CU(*args, **kwargs) Overloaded function. | |
| VQGate | CU (int control_qbit_idx, int target_qbit_idx, float param1, float param2, float param3, param4) |
| CU(*args, **kwargs) Overloaded function. | |
| QGate | CZ (int qubit1, int qubit2) |
| CZ(qubit1: int, qubit2: int) -> core.QGate. | |
| QGate | ECHO (int qubit) |
| ECHO(qubit: int) -> core.QGate. | |
| QGate | H (int qubit) |
| H(qubit: int) -> core.QGate. | |
| QGate | I (int qubit) |
| I(qubit: int) -> core.QGate. | |
| QGate | IDLE (int qubit, float theta) |
| IDLE(*args, **kwargs) Overloaded function. | |
| VQGate | IDLE (int qbit_idx, param) |
| IDLE(*args, **kwargs) Overloaded function. | |
| QGate | ISWAP (int qubit1, int qubit2) |
| ISWAP(qubit1: int, qubit2: int) -> core.QGate. | |
| QGate | MS (int qubit1, int qubit2) |
| MS(qubit1: int, qubit2: int) -> core.QGate. | |
| QGate | Oracle (list[int] qubits, numpy.ndarray[numpy.complex128[m, n]] matrix) |
| Oracle(qubits: list[int], matrix: numpy.ndarray[numpy.complex128[m, n]]) -> core.QGate. | |
| QGate | P (int qubit, float theta) |
| P(*args, **kwargs) Overloaded function. | |
| VQGate | P (int qbit_idx, param) |
| P(*args, **kwargs) Overloaded function. | |
| QCircuit | QV (int num_qubit, int depth, int seed) |
| QV(num_qubit: int, depth: int, seed: int) -> core.QCircuit. | |
| QGate | RPHI (int control, float theta, float phi) |
| RPHI(control: int, theta: float, phi: float) -> core.QGate. | |
| VQGate | RPhi (int qbit_idx, param1, param2) |
| RPhi(*args, **kwargs) Overloaded function. | |
| VQGate | RPhi (int qbit_idx, float param1, param2) |
| RPhi(*args, **kwargs) Overloaded function. | |
| QGate | RX (int qubit, float theta) |
| RX(*args, **kwargs) Overloaded function. | |
| VQGate | RX (int qbit_idx, param) |
| RX(*args, **kwargs) Overloaded function. | |
| QGate | RXX (int control, int target, float theta) |
| RXX(*args, **kwargs) Overloaded function. | |
| VQGate | RXX (int control_qbit_idx, int target_qbit_idx, param) |
| RXX(*args, **kwargs) Overloaded function. | |
| QGate | RY (int qubit, float theta) |
| RY(*args, **kwargs) Overloaded function. | |
| VQGate | RY (int qbit_idx, param) |
| RY(*args, **kwargs) Overloaded function. | |
| QGate | RYY (int control, int target, float theta) |
| RYY(*args, **kwargs) Overloaded function. | |
| VQGate | RYY (int control_qbit_idx, int target_qbit_idx, param) |
| RYY(*args, **kwargs) Overloaded function. | |
| QGate | RZ (int qubit, float theta) |
| RZ(*args, **kwargs) Overloaded function. | |
| VQGate | RZ (int qbit_idx, param) |
| RZ(*args, **kwargs) Overloaded function. | |
| QGate | RZX (int control, int target, float theta) |
| RZX(*args, **kwargs) Overloaded function. | |
| VQGate | RZX (int control_qbit_idx, int target_qbit_idx, param) |
| RZX(*args, **kwargs) Overloaded function. | |
| QGate | RZZ (int control, int target, float theta) |
| RZZ(*args, **kwargs) Overloaded function. | |
| VQGate | RZZ (int control_qbit_idx, int target_qbit_idx, param) |
| RZZ(*args, **kwargs) Overloaded function. | |
| QGate | S (int qubit) |
| S(qubit: int) -> core.QGate. | |
| QGate | SQISWAP (int qubit1, int qubit2) |
| SQISWAP(qubit1: int, qubit2: int) -> core.QGate. | |
| QGate | SWAP (int qubit1, int qubit2) |
| SWAP(qubit1: int, qubit2: int) -> core.QGate. | |
| QGate | T (int qubit) |
| T(qubit: int) -> core.QGate. | |
| QGate | TOFFOLI (int qubit1, int qubit2, int qubit3) |
| TOFFOLI(qubit1: int, qubit2: int, qubit3: int) -> core.QGate. | |
| QGate | U1 (int qubit, float theta) |
| U1(*args, **kwargs) Overloaded function. | |
| VQGate | U1 (int qbit_idx, param) |
| U1(*args, **kwargs) Overloaded function. | |
| QGate | U2 (int qubit, float theta, float phi) |
| U2(*args, **kwargs) Overloaded function. | |
| VQGate | U2 (int qbit_idx, param1, param2) |
| U2(*args, **kwargs) Overloaded function. | |
| VQGate | U2 (int qbit_idx, float param1, param2) |
| U2(*args, **kwargs) Overloaded function. | |
| QGate | U3 (int qubit, float theta, float phi, float _lambda) |
| U3(*args, **kwargs) Overloaded function. | |
| VQGate | U3 (int qbit_idx, param1, param2, param3) |
| U3(*args, **kwargs) Overloaded function. | |
| VQGate | U3 (int qbit_idx, float param1, param2, param3) |
| U3(*args, **kwargs) Overloaded function. | |
| VQGate | U3 (int qbit_idx, float param1, float param2, param3) |
| U3(*args, **kwargs) Overloaded function. | |
| QGate | U4 (int qubit, float theta, float phi, float _lambda, float gamma) |
| U4(*args, **kwargs) Overloaded function. | |
| VQGate | U4 (int qbit_idx, param1, param2, param3, param4) |
| U4(*args, **kwargs) Overloaded function. | |
| VQGate | U4 (int qbit_idx, float param1, param2, param3, param4) |
| U4(*args, **kwargs) Overloaded function. | |
| VQGate | U4 (int qbit_idx, float param1, float param2, param3, param4) |
| U4(*args, **kwargs) Overloaded function. | |
| VQGate | U4 (int qbit_idx, float param1, float param2, float param3, param4) |
| U4(*args, **kwargs) Overloaded function. | |
| QGate | X (int qubit) |
| X(qubit: int) -> core.QGate. | |
| QGate | X1 (int qubit) |
| X1(qubit: int) -> core.QGate. | |
| QGate | Y (int qubit) |
| Y(qubit: int) -> core.QGate. | |
| QGate | Y1 (int qubit) |
| Y1(qubit: int) -> core.QGate. | |
| QGate | Z (int qubit) |
| Z(qubit: int) -> core.QGate. | |
| QGate | Z1 (int qubit) |
| Z1(qubit: int) -> core.QGate. | |
| QuantumError | amplitude_damping_error (float prob) |
| amplitude_damping_error(prob: float) -> core.QuantumError | |
| QGate | create_gate (str gate_name, list[int] qubits, list[float] params) |
| create_gate(gate_name: str, qubits: list[int], params: list[float]) -> core.QGate | |
| QuantumError | decoherence_error (float arg0, float arg1, float arg2) |
| decoherence_error(arg0: float, arg1: float, arg2: float) -> core.QuantumError | |
| QuantumError | depolarizing_error (float prob) |
| depolarizing_error(prob: float) -> core.QuantumError | |
| QProg | direct_twirl (QProg arg0, str arg1, int arg2) |
| direct_twirl(arg0: core.QProg, arg1: str, arg2: int) -> core.QProg | |
| str | draw_qprog (QProg qprog, PIC_TYPE p=..., dict[str, int] expend_map=..., bool param_show=..., bool with_logo=..., int line_length=..., str output_file=..., str encode=...) |
| draw_qprog(*args, **kwargs) Overloaded function. | |
| str | draw_qprog (QCircuit circuit, PIC_TYPE p=..., dict[str, int] expend_map=..., bool param_show=..., bool with_logo=..., int line_length=..., str output_file=..., str encode=...) |
| draw_qprog(*args, **kwargs) Overloaded function. | |
| float | expval_hamiltonian (QProg node, hamiltonian, int shots=..., NoiseModel model=..., int used_threads=..., str backend=...) |
| expval_hamiltonian(node: core.QProg, hamiltonian: QPanda3::Hamiltonian, shots: int = 1, model: core.NoiseModel = <core.NoiseModel object at 0x7ffb6892c470>, used_threads: int = 4, backend: str = \'CPU\') -> float | |
| float | expval_pauli_operator (QProg node, pauli_operator, int shots=..., NoiseModel model=..., int used_threads=..., str backend=...) |
| expval_pauli_operator(node: core.QProg, pauli_operator: QPanda3::PauliOperator, shots: int = 1, model: core.NoiseModel = <core.NoiseModel object at 0x7ffb6892c530>, used_threads: int = 4, backend: str = \'CPU\') -> float | |
| MeasureNode | measure (int qubit, int cbit) |
| measure(*args, **kwargs) Overloaded function. | |
| list[MeasureNode] | measure (list[int] qubits, list[int] cbits) |
| measure(*args, **kwargs) Overloaded function. | |
| QuantumError | pauli_x_error (float prob) |
| pauli_x_error(prob: float) -> core.QuantumError | |
| QuantumError | pauli_y_error (float prob) |
| pauli_y_error(prob: float) -> core.QuantumError | |
| QuantumError | pauli_z_error (float prob) |
| pauli_z_error(prob: float) -> core.QuantumError | |
| QuantumError | phase_damping_error (float prob) |
| phase_damping_error(prob: float) -> core.QuantumError | |
| QIf | qif (list[int] cbits) |
| qif(cbits: list[int]) -> core.QIf | |
| QWhile | qwhile (list[int] cbits) |
| qwhile(cbits: list[int]) -> core.QWhile | |
| QCircuit | random_qcircuit (list[int] qubits, int depth, list[str] gate_type) |
| random_qcircuit(qubits: list[int], depth: int, gate_type: list[str]) -> core.QCircuit | |
| None | set_print_options (int precision=..., int param_show=..., int linewidth=...) |
| set_print_options(precision: int = 8, param_show: int = True, linewidth: int = 100) -> None | |
| QuantumError pyqpanda3.core.core.amplitude_damping_error | ( | float | prob | ) |
amplitude_damping_error(prob: float) -> core.QuantumError
Create an amplitude damping error.
| QGate pyqpanda3.core.core.BARRIER | ( | list[int] | qubits | ) |
BARRIER(qubits: list[int]) -> core.QGate.
Apply the BARRIER operation to input qubits.
The BARRIER operation prevents any operations from being moved above this point in the circuit.
Matrix representation:
BARRIER does not have a matrix representation since it does not change the quantum state.
| QGate pyqpanda3.core.core.CNOT | ( | int | qubit1, |
| int | qubit2 ) |
CNOT(qubit1: int, qubit2: int) -> core.QGate.
Apply the CNOT (controlled-NOT) gate to two qubits.
Matrix representation:
CNOT = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}
| QGate pyqpanda3.core.core.CP | ( | int | control, |
| int | target, | ||
| float | theta ) |
CP(*args, **kwargs) Overloaded function.
Apply the CP gate to a qubit.
Matrix representation:
CP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & \exp(i\theta) \end{bmatrix}
Apply the CP gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CP | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
CP(*args, **kwargs) Overloaded function.
Apply the CP gate to a qubit.
Matrix representation:
CP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & \exp(i\theta) \end{bmatrix}
Apply the CP gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.CR | ( | int | control, |
| int | target, | ||
| float | theta ) |
CR(*args, **kwargs) Overloaded function.
CR is equivalently replaced with CP, Apply the CP gate to a qubit.
Matrix representation:
CR = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & \exp(i\theta) \end{bmatrix}
Apply the CR gate to a qubit with an angle.
This gate is same with CP gate. Here, the gate type of it will be same with CP gate.
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CR | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
CR(*args, **kwargs) Overloaded function.
CR is equivalently replaced with CP, Apply the CP gate to a qubit.
Matrix representation:
CR = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & \exp(i\theta) \end{bmatrix}
Apply the CR gate to a qubit with an angle.
This gate is same with CP gate. Here, the gate type of it will be same with CP gate.
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.create_gate | ( | str | gate_name, |
| list[int] | qubits, | ||
| list[float] | params ) |
create_gate(gate_name: str, qubits: list[int], params: list[float]) -> core.QGate
| QGate pyqpanda3.core.core.CRX | ( | int | control, |
| int | target, | ||
| float | theta ) |
CRX(*args, **kwargs) Overloaded function.
Apply the CRX gate to a qubit.
Apply the CRX gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CRX | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
CRX(*args, **kwargs) Overloaded function.
Apply the CRX gate to a qubit.
Apply the CRX gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.CRY | ( | int | control, |
| int | target, | ||
| float | theta ) |
CRY(*args, **kwargs) Overloaded function.
Apply the CRY gate to a qubit.
Apply the CRY gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CRY | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
CRY(*args, **kwargs) Overloaded function.
Apply the CRY gate to a qubit.
Apply the CRY gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.CRZ | ( | int | control, |
| int | target, | ||
| float | theta ) |
CRZ(*args, **kwargs) Overloaded function.
Apply the CRZ gate to a qubit.
Apply the CRZ gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CRZ | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
CRZ(*args, **kwargs) Overloaded function.
Apply the CRZ gate to a qubit.
Apply the CRZ gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.CU | ( | int | control, |
| int | target, | ||
| float | theta, | ||
| float | phi, | ||
| float | _lambda, | ||
| float | gamma ) |
CU(*args, **kwargs) Overloaded function.
Apply the CU (controlled-U) gate to two qubits.
Matrix representation:
CU = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_0 & u_1 \\ 0 & 0 & u_2 & u_3 \end{bmatrix}
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to ppdate the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CU | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| float | param1, | ||
| float | param2, | ||
| float | param3, | ||
| param4 ) |
CU(*args, **kwargs) Overloaded function.
Apply the CU (controlled-U) gate to two qubits.
Matrix representation:
CU = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_0 & u_1 \\ 0 & 0 & u_2 & u_3 \end{bmatrix}
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to ppdate the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CU | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| float | param1, | ||
| float | param2, | ||
| param3, | |||
| param4 ) |
CU(*args, **kwargs) Overloaded function.
Apply the CU (controlled-U) gate to two qubits.
Matrix representation:
CU = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_0 & u_1 \\ 0 & 0 & u_2 & u_3 \end{bmatrix}
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to ppdate the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CU | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| float | param1, | ||
| param2, | |||
| param3, | |||
| param4 ) |
CU(*args, **kwargs) Overloaded function.
Apply the CU (controlled-U) gate to two qubits.
Matrix representation:
CU = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_0 & u_1 \\ 0 & 0 & u_2 & u_3 \end{bmatrix}
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to ppdate the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.CU | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param1, | |||
| param2, | |||
| param3, | |||
| param4 ) |
CU(*args, **kwargs) Overloaded function.
Apply the CU (controlled-U) gate to two qubits.
Matrix representation:
CU = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & u_0 & u_1 \\ 0 & 0 & u_2 & u_3 \end{bmatrix}
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to ppdate the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the CU gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.CZ | ( | int | qubit1, |
| int | qubit2 ) |
CZ(qubit1: int, qubit2: int) -> core.QGate.
Apply the CZ (controlled-Z) gate to two qubits.
Matrix representation:
CZ = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & -1 \end{bmatrix}
| QuantumError pyqpanda3.core.core.decoherence_error | ( | float | arg0, |
| float | arg1, | ||
| float | arg2 ) |
decoherence_error(arg0: float, arg1: float, arg2: float) -> core.QuantumError
Create a decoherence error.
| QuantumError pyqpanda3.core.core.depolarizing_error | ( | float | prob | ) |
depolarizing_error(prob: float) -> core.QuantumError
Create a depolarizing error.
direct_twirl(arg0: core.QProg, arg1: str, arg2: int) -> core.QProg
Perform direct twirling on a quantum circuit.
| input_circ | The input quantum circuit to twirl. |
| twirled_gate | The gate to use for the twirling operation (default is 'CNOT'). |
| seed | The random seed to use for the twirling (default is 0). |
| str pyqpanda3.core.core.draw_qprog | ( | QCircuit | circuit, |
| PIC_TYPE | p = ..., | ||
| dict[str, int] | expend_map = ..., | ||
| bool | param_show = ..., | ||
| bool | with_logo = ..., | ||
| int | line_length = ..., | ||
| str | output_file = ..., | ||
| str | encode = ... ) |
draw_qprog(*args, **kwargs) Overloaded function.
Draws a quantum program (QProg) graphically. This function generates a graphical representation of the given quantum program object.
| circuit | A reference to the quantum program object of type QProg that needs to be drawn. |
| p | The drawing type, defaulting to PIC_TYPE.TEXT, which means to draw in text format. |
| expend_map | A map used to control drawing expansion options, defaulting to { {"all", 1} }. This parameter can specify whether to expand all subprograms. |
| param_show | A boolean indicating whether to show parameters, defaulting to false. |
| with_logo | A boolean indicating whether to include a logo in the output, defaulting to false. |
| line_length | The maximum character length per line, defaulting to 100. |
| output_file | The path for the output file, defaulting to an empty string, which means do not write to a file. |
Draws a QCircuit graphically. This function generates a graphical representation of the given quantum program object.
| circuit | A reference to the quantum program object of type QProg that needs to be drawn. |
| p | The drawing type, defaulting to PIC_TYPE.TEXT, which means to draw in text format. |
| expend_map | A map used to control drawing expansion options, defaulting to { {"all", 1} }. This parameter can specify whether to expand all subprograms. |
| param_show | A boolean indicating whether to show parameters, defaulting to false. |
| with_logo | A boolean indicating whether to include a logo in the output, defaulting to false. |
| line_length | The maximum character length per line, defaulting to 100. |
| output_file | The path for the output file, defaulting to an empty string, which means do not write to a file. |
| str pyqpanda3.core.core.draw_qprog | ( | QProg | qprog, |
| PIC_TYPE | p = ..., | ||
| dict[str, int] | expend_map = ..., | ||
| bool | param_show = ..., | ||
| bool | with_logo = ..., | ||
| int | line_length = ..., | ||
| str | output_file = ..., | ||
| str | encode = ... ) |
draw_qprog(*args, **kwargs) Overloaded function.
Draws a quantum program (QProg) graphically. This function generates a graphical representation of the given quantum program object.
| circuit | A reference to the quantum program object of type QProg that needs to be drawn. |
| p | The drawing type, defaulting to PIC_TYPE.TEXT, which means to draw in text format. |
| expend_map | A map used to control drawing expansion options, defaulting to { {"all", 1} }. This parameter can specify whether to expand all subprograms. |
| param_show | A boolean indicating whether to show parameters, defaulting to false. |
| with_logo | A boolean indicating whether to include a logo in the output, defaulting to false. |
| line_length | The maximum character length per line, defaulting to 100. |
| output_file | The path for the output file, defaulting to an empty string, which means do not write to a file. |
Draws a QCircuit graphically. This function generates a graphical representation of the given quantum program object.
| circuit | A reference to the quantum program object of type QProg that needs to be drawn. |
| p | The drawing type, defaulting to PIC_TYPE.TEXT, which means to draw in text format. |
| expend_map | A map used to control drawing expansion options, defaulting to { {"all", 1} }. This parameter can specify whether to expand all subprograms. |
| param_show | A boolean indicating whether to show parameters, defaulting to false. |
| with_logo | A boolean indicating whether to include a logo in the output, defaulting to false. |
| line_length | The maximum character length per line, defaulting to 100. |
| output_file | The path for the output file, defaulting to an empty string, which means do not write to a file. |
| QGate pyqpanda3.core.core.ECHO | ( | int | qubit | ) |
ECHO(qubit: int) -> core.QGate.
Apply the ECHO gate to qubit.
| float pyqpanda3.core.core.expval_hamiltonian | ( | QProg | node, |
| hamiltonian, | |||
| int | shots = ..., | ||
| NoiseModel | model = ..., | ||
| int | used_threads = ..., | ||
| str | backend = ... ) |
expval_hamiltonian(node: core.QProg, hamiltonian: QPanda3::Hamiltonian, shots: int = 1, model: core.NoiseModel = <core.NoiseModel object at 0x7ffb6892c470>, used_threads: int = 4, backend: str = \'CPU\') -> float
Calculates the expectation value of a given Hamiltonian with respect to a quantum program.
This function evaluates the expectation value of a Hamiltonian on a quantum state prepared by a quantum program (QProg). The calculation can be performed with optional noise modeling and parallelization.
| node | The quantum program (QProg) that prepares the state for which the expectation value is calculated. |
| hamiltonian | The Hamiltonian operator for which the expectation value is to be computed. |
| shots | The number of measurements to perform. Default is 1. |
| model | The noise model to apply during the simulation. Default is an empty (ideal) NoiseModel. |
| used_threads | The number of threads to use for parallel computation. Default is 4. |
| backend | Specifies the backend for computation ("CPU" by default,but you can select "GPU"). |
| float pyqpanda3.core.core.expval_pauli_operator | ( | QProg | node, |
| pauli_operator, | |||
| int | shots = ..., | ||
| NoiseModel | model = ..., | ||
| int | used_threads = ..., | ||
| str | backend = ... ) |
expval_pauli_operator(node: core.QProg, pauli_operator: QPanda3::PauliOperator, shots: int = 1, model: core.NoiseModel = <core.NoiseModel object at 0x7ffb6892c530>, used_threads: int = 4, backend: str = \'CPU\') -> float
Calculates the expectation value of a given Pauli operator with respect to a quantum program.
This function evaluates the expectation value of a Pauli operator on a quantum state prepared by a quantum program (QProg). The calculation can be performed with optional noise modeling and parallelization.
| node | The quantum program (QProg) that prepares the state for which the expectation value is calculated. |
| pauli_operator | The Pauli operator for which the expectation value is to be computed. |
| shots | The number of measurements to perform. Default is 1. |
| model | The noise model to apply during the simulation. Default is an empty (ideal) NoiseModel. |
| used_threads | The number of threads to use for parallel computation. Default is 4. |
| backend | Specifies the backend for computation ("CPU" by default,but you can select "GPU"). |
| QGate pyqpanda3.core.core.H | ( | int | qubit | ) |
H(qubit: int) -> core.QGate.
Apply the Hadamard gate to a qubit.
Matrix representation:
H = \begin{bmatrix} \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \end{bmatrix}
| QGate pyqpanda3.core.core.I | ( | int | qubit | ) |
I(qubit: int) -> core.QGate.
Apply the identity gate to a qubit.
Matrix representation:
I = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}
| VQGate pyqpanda3.core.core.IDLE | ( | int | qbit_idx, |
| param ) |
IDLE(*args, **kwargs) Overloaded function.
Apply the IDLE gate to a qubit.
Apply the IDLE gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the IDLE gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.IDLE | ( | int | qubit, |
| float | theta ) |
IDLE(*args, **kwargs) Overloaded function.
Apply the IDLE gate to a qubit.
Apply the IDLE gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the IDLE gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.ISWAP | ( | int | qubit1, |
| int | qubit2 ) |
ISWAP(qubit1: int, qubit2: int) -> core.QGate.
Apply the ISWAP gate to two qubits.
Matrix representation:
ISWAP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & \cos(\theta) & i\sin(\theta) & 0 \\ 0 & i\sin(\theta) & \cos(\theta) & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}
| MeasureNode pyqpanda3.core.core.measure | ( | int | qubit, |
| int | cbit ) |
measure(*args, **kwargs) Overloaded function.
Create a measure node.
Create the measure nodes.
| list[MeasureNode] pyqpanda3.core.core.measure | ( | list[int] | qubits, |
| list[int] | cbits ) |
measure(*args, **kwargs) Overloaded function.
Create a measure node.
Create the measure nodes.
| QGate pyqpanda3.core.core.MS | ( | int | qubit1, |
| int | qubit2 ) |
MS(qubit1: int, qubit2: int) -> core.QGate.
Apply the MS gate to two qubits.
| QGate pyqpanda3.core.core.Oracle | ( | list[int] | qubits, |
| numpy.ndarray[numpy.complex128[m, n]] | matrix ) |
Oracle(qubits: list[int], matrix: numpy.ndarray[numpy.complex128[m, n]]) -> core.QGate.
Apply the Oracle gate to qubits.
| VQGate pyqpanda3.core.core.P | ( | int | qbit_idx, |
| param ) |
P(*args, **kwargs) Overloaded function.
Apply the P gate to a qubit.
Apply the P gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.P | ( | int | qubit, |
| float | theta ) |
P(*args, **kwargs) Overloaded function.
Apply the P gate to a qubit.
Apply the P gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QuantumError pyqpanda3.core.core.pauli_x_error | ( | float | prob | ) |
pauli_x_error(prob: float) -> core.QuantumError
Create a Pauli-X error.
| QuantumError pyqpanda3.core.core.pauli_y_error | ( | float | prob | ) |
pauli_y_error(prob: float) -> core.QuantumError
Create a Pauli-Y error.
| QuantumError pyqpanda3.core.core.pauli_z_error | ( | float | prob | ) |
pauli_z_error(prob: float) -> core.QuantumError
Create a Pauli-Z error.
| QuantumError pyqpanda3.core.core.phase_damping_error | ( | float | prob | ) |
phase_damping_error(prob: float) -> core.QuantumError
Create a phase damping error.
| QCircuit pyqpanda3.core.core.QV | ( | int | num_qubit, |
| int | depth, | ||
| int | seed ) |
QV(num_qubit: int, depth: int, seed: int) -> core.QCircuit.
Perform a quantum volume (QV) test.
| num_qubit | The number of qubits for the quantum circuit. |
| depth | The depth (number of layers) of the quantum circuit. |
| seed | The random seed to use for the circuit generation. |
| QWhile pyqpanda3.core.core.qwhile | ( | list[int] | cbits | ) |
qwhile(cbits: list[int]) -> core.QWhile
| QCircuit pyqpanda3.core.core.random_qcircuit | ( | list[int] | qubits, |
| int | depth, | ||
| list[str] | gate_type ) |
random_qcircuit(qubits: list[int], depth: int, gate_type: list[str]) -> core.QCircuit
Generate a random quantum circuit.
| qubits | The number of qubits in the circuit. |
| depth | The depth (number of layers) of the quantum circuit. |
| gate_type | The type of gates to use in the circuit. |
| QGate pyqpanda3.core.core.RPHI | ( | int | control, |
| float | theta, | ||
| float | phi ) |
RPHI(control: int, theta: float, phi: float) -> core.QGate.
Apply the RPHI gate to a qubit.
| VQGate pyqpanda3.core.core.RPhi | ( | int | qbit_idx, |
| float | param1, | ||
| param2 ) |
RPhi(*args, **kwargs) Overloaded function.
Apply the RPhi gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the RPhi gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RPhi | ( | int | qbit_idx, |
| param1, | |||
| param2 ) |
RPhi(*args, **kwargs) Overloaded function.
Apply the RPhi gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the RPhi gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RX | ( | int | qbit_idx, |
| param ) |
RX(*args, **kwargs) Overloaded function.
Apply the RX rotation gate to a qubit.
Matrix representation:
RX = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -i\sin\left(\frac{\theta}{2}\right) \\ -i\sin\left(\frac{\theta}{2}\right) & \cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the RX gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RX | ( | int | qubit, |
| float | theta ) |
RX(*args, **kwargs) Overloaded function.
Apply the RX rotation gate to a qubit.
Matrix representation:
RX = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -i\sin\left(\frac{\theta}{2}\right) \\ -i\sin\left(\frac{\theta}{2}\right) & \cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the RX gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RXX | ( | int | control, |
| int | target, | ||
| float | theta ) |
RXX(*args, **kwargs) Overloaded function.
Apply the RXX gate to two qubits.
Matrix representation:
RXX = \begin{bmatrix} \cos(\theta/2) & 0 & 0 & -i\sin(\theta/2) \\ 0 & \cos(\theta/2) & -i\sin(\theta/2) & 0 \\ 0 & -i\sin(\theta/2) & \cos(\theta/2) & 0 \\ -i\sin(\theta/2) & 0 & 0 & \cos(\theta/2) \end{bmatrix}
Apply the RXX gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RXX | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
RXX(*args, **kwargs) Overloaded function.
Apply the RXX gate to two qubits.
Matrix representation:
RXX = \begin{bmatrix} \cos(\theta/2) & 0 & 0 & -i\sin(\theta/2) \\ 0 & \cos(\theta/2) & -i\sin(\theta/2) & 0 \\ 0 & -i\sin(\theta/2) & \cos(\theta/2) & 0 \\ -i\sin(\theta/2) & 0 & 0 & \cos(\theta/2) \end{bmatrix}
Apply the RXX gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RY | ( | int | qbit_idx, |
| param ) |
RY(*args, **kwargs) Overloaded function.
Apply the RY rotation gate to a qubit.
Matrix representation:
RY = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -\sin\left(\frac{\theta}{2}\right) \\ \sin\left(\frac{\theta}{2}\right) & \cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the RY gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RY | ( | int | qubit, |
| float | theta ) |
RY(*args, **kwargs) Overloaded function.
Apply the RY rotation gate to a qubit.
Matrix representation:
RY = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -\sin\left(\frac{\theta}{2}\right) \\ \sin\left(\frac{\theta}{2}\right) & \cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the RY gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RYY | ( | int | control, |
| int | target, | ||
| float | theta ) |
RYY(*args, **kwargs) Overloaded function.
Apply the RYY gate to two qubits.
Matrix representation:
RYY = \begin{bmatrix} \cos(\theta/2) & 0 & 0 & i\sin(\theta/2) \\ 0 & \cos(\theta/2) & -i\sin(\theta/2) & 0 \\ 0 & -i\sin(\theta/2) & \cos(\theta/2) & 0 \\ i\sin(\theta/2) & 0 & 0 & \cos(\theta/2) \end{bmatrix}
Apply the RYY gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RYY | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
RYY(*args, **kwargs) Overloaded function.
Apply the RYY gate to two qubits.
Matrix representation:
RYY = \begin{bmatrix} \cos(\theta/2) & 0 & 0 & i\sin(\theta/2) \\ 0 & \cos(\theta/2) & -i\sin(\theta/2) & 0 \\ 0 & -i\sin(\theta/2) & \cos(\theta/2) & 0 \\ i\sin(\theta/2) & 0 & 0 & \cos(\theta/2) \end{bmatrix}
Apply the RYY gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RZ | ( | int | qbit_idx, |
| param ) |
RZ(*args, **kwargs) Overloaded function.
Apply the RZ rotation gate to a qubit.
Matrix representation:
RZ = \begin{bmatrix} \exp\left(-\frac{i\theta}{2}\right) & 0 \\ 0 & \exp\left(\frac{i\theta}{2}\right) \end{bmatrix}
Apply the RZ gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RZ | ( | int | qubit, |
| float | theta ) |
RZ(*args, **kwargs) Overloaded function.
Apply the RZ rotation gate to a qubit.
Matrix representation:
RZ = \begin{bmatrix} \exp\left(-\frac{i\theta}{2}\right) & 0 \\ 0 & \exp\left(\frac{i\theta}{2}\right) \end{bmatrix}
Apply the RZ gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RZX | ( | int | control, |
| int | target, | ||
| float | theta ) |
RZX(*args, **kwargs) Overloaded function.
Apply the RZX gate to two qubits.
Matrix representation:
RZX = \begin{bmatrix} \cos(\theta/2) & 0 & -i\sin(\theta/2) & 0 \\ 0 & \cos(\theta/2) & 0 & i\sin(\theta/2) \\ -i\sin(\theta/2) & 0 & \cos(\theta/2) & 0 \\ 0 & i\sin(\theta/2) & 0 & \cos(\theta/2) \end{bmatrix}
Apply the RZX gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RZX | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
RZX(*args, **kwargs) Overloaded function.
Apply the RZX gate to two qubits.
Matrix representation:
RZX = \begin{bmatrix} \cos(\theta/2) & 0 & -i\sin(\theta/2) & 0 \\ 0 & \cos(\theta/2) & 0 & i\sin(\theta/2) \\ -i\sin(\theta/2) & 0 & \cos(\theta/2) & 0 \\ 0 & i\sin(\theta/2) & 0 & \cos(\theta/2) \end{bmatrix}
Apply the RZX gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.RZZ | ( | int | control, |
| int | target, | ||
| float | theta ) |
RZZ(*args, **kwargs) Overloaded function.
Apply the RZZ gate to two qubits.
Matrix representation:
RZZ = \begin{bmatrix} \exp(-i\theta/2) & 0 & 0 & 0 \\ 0 & \exp(i\theta/2) & 0 & 0 \\ 0 & 0 & \exp(i\theta/2) & 0 \\ 0 & 0 & 0 & \exp(-i\theta/2) \end{bmatrix}
Apply the RZZ gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.RZZ | ( | int | control_qbit_idx, |
| int | target_qbit_idx, | ||
| param ) |
RZZ(*args, **kwargs) Overloaded function.
Apply the RZZ gate to two qubits.
Matrix representation:
RZZ = \begin{bmatrix} \exp(-i\theta/2) & 0 & 0 & 0 \\ 0 & \exp(i\theta/2) & 0 & 0 \\ 0 & 0 & \exp(i\theta/2) & 0 \\ 0 & 0 & 0 & \exp(-i\theta/2) \end{bmatrix}
Apply the RZZ gate to a qubit with an angle
| control_qbit_idx | the idx of qbit which will control the target_qbit_idx |
| target_qbit_idx | the idx of qbit which will be controled by the control_qbit_idx |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.S | ( | int | qubit | ) |
S(qubit: int) -> core.QGate.
Apply the S gate to a qubit.
Matrix representation:
S = \begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix}
| None pyqpanda3.core.core.set_print_options | ( | int | precision = ..., |
| int | param_show = ..., | ||
| int | linewidth = ... ) |
set_print_options(precision: int = 8, param_show: int = True, linewidth: int = 100) -> None
Set the print options
| QGate pyqpanda3.core.core.SQISWAP | ( | int | qubit1, |
| int | qubit2 ) |
SQISWAP(qubit1: int, qubit2: int) -> core.QGate.
Apply the SQISWAP gate to two qubits.
| QGate pyqpanda3.core.core.SWAP | ( | int | qubit1, |
| int | qubit2 ) |
SWAP(qubit1: int, qubit2: int) -> core.QGate.
Apply the SWAP gate to two qubits.
Matrix representation:
SWAP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}
| QGate pyqpanda3.core.core.T | ( | int | qubit | ) |
T(qubit: int) -> core.QGate.
Apply the T gate to a qubit.
Matrix representation:
T = \begin{bmatrix} 1 & 0 \\ 0 & \exp\left(\frac{i\pi}{4}\right) \end{bmatrix}
| QGate pyqpanda3.core.core.TOFFOLI | ( | int | qubit1, |
| int | qubit2, | ||
| int | qubit3 ) |
TOFFOLI(qubit1: int, qubit2: int, qubit3: int) -> core.QGate.
Apply the TOFFOLI gate (controlled-controlled-NOT) to three qubits.
Matrix representation:
TOFFOLI = \begin{bmatrix} 1 & 0 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1 \end{bmatrix}
| VQGate pyqpanda3.core.core.U1 | ( | int | qbit_idx, |
| param ) |
U1(*args, **kwargs) Overloaded function.
Apply the U1 gate to a qubit.
Matrix representation:
U1 = \begin{bmatrix} 1 & 0 \\ 0 & \exp(i\theta) \end{bmatrix}
Apply the U1 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.U1 | ( | int | qubit, |
| float | theta ) |
U1(*args, **kwargs) Overloaded function.
Apply the U1 gate to a qubit.
Matrix representation:
U1 = \begin{bmatrix} 1 & 0 \\ 0 & \exp(i\theta) \end{bmatrix}
Apply the U1 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U2 | ( | int | qbit_idx, |
| float | param1, | ||
| param2 ) |
U2(*args, **kwargs) Overloaded function.
Apply the U2 gate to a qubit.
Matrix representation:
U2 = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{\exp(i\lambda)}{\sqrt{2}} \\ \frac{\exp(i\phi)}{\sqrt{2}} & \frac{\exp(i\lambda + i\phi)}{\sqrt{2}} \end{bmatrix}
Apply the U2 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U2 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U2 | ( | int | qbit_idx, |
| param1, | |||
| param2 ) |
U2(*args, **kwargs) Overloaded function.
Apply the U2 gate to a qubit.
Matrix representation:
U2 = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{\exp(i\lambda)}{\sqrt{2}} \\ \frac{\exp(i\phi)}{\sqrt{2}} & \frac{\exp(i\lambda + i\phi)}{\sqrt{2}} \end{bmatrix}
Apply the U2 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U2 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.U2 | ( | int | qubit, |
| float | theta, | ||
| float | phi ) |
U2(*args, **kwargs) Overloaded function.
Apply the U2 gate to a qubit.
Matrix representation:
U2 = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{\exp(i\lambda)}{\sqrt{2}} \\ \frac{\exp(i\phi)}{\sqrt{2}} & \frac{\exp(i\lambda + i\phi)}{\sqrt{2}} \end{bmatrix}
Apply the U2 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U2 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U3 | ( | int | qbit_idx, |
| float | param1, | ||
| float | param2, | ||
| param3 ) |
U3(*args, **kwargs) Overloaded function.
Apply the U3 gate to a qubit.
Matrix representation:
U3 = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -\exp(i\lambda)\sin\left(\frac{\theta}{2}\right) \\ \exp(i\phi)\sin\left(\frac{\theta}{2}\right) & \exp(i\lambda + i\phi)\cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U3 | ( | int | qbit_idx, |
| float | param1, | ||
| param2, | |||
| param3 ) |
U3(*args, **kwargs) Overloaded function.
Apply the U3 gate to a qubit.
Matrix representation:
U3 = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -\exp(i\lambda)\sin\left(\frac{\theta}{2}\right) \\ \exp(i\phi)\sin\left(\frac{\theta}{2}\right) & \exp(i\lambda + i\phi)\cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U3 | ( | int | qbit_idx, |
| param1, | |||
| param2, | |||
| param3 ) |
U3(*args, **kwargs) Overloaded function.
Apply the U3 gate to a qubit.
Matrix representation:
U3 = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -\exp(i\lambda)\sin\left(\frac{\theta}{2}\right) \\ \exp(i\phi)\sin\left(\frac{\theta}{2}\right) & \exp(i\lambda + i\phi)\cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.U3 | ( | int | qubit, |
| float | theta, | ||
| float | phi, | ||
| float | _lambda ) |
U3(*args, **kwargs) Overloaded function.
Apply the U3 gate to a qubit.
Matrix representation:
U3 = \begin{bmatrix} \cos\left(\frac{\theta}{2}\right) & -\exp(i\lambda)\sin\left(\frac{\theta}{2}\right) \\ \exp(i\phi)\sin\left(\frac{\theta}{2}\right) & \exp(i\lambda + i\phi)\cos\left(\frac{\theta}{2}\right) \end{bmatrix}
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U3 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U4 | ( | int | qbit_idx, |
| float | param1, | ||
| float | param2, | ||
| float | param3, | ||
| param4 ) |
U4(*args, **kwargs) Overloaded function.
Apply the U4 gate to a qubit.
Matrix representation:
U4 = \begin{bmatrix} u_0 & u_1 \\ u_2 & u_3 \end{bmatrix}
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U4 | ( | int | qbit_idx, |
| float | param1, | ||
| float | param2, | ||
| param3, | |||
| param4 ) |
U4(*args, **kwargs) Overloaded function.
Apply the U4 gate to a qubit.
Matrix representation:
U4 = \begin{bmatrix} u_0 & u_1 \\ u_2 & u_3 \end{bmatrix}
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U4 | ( | int | qbit_idx, |
| float | param1, | ||
| param2, | |||
| param3, | |||
| param4 ) |
U4(*args, **kwargs) Overloaded function.
Apply the U4 gate to a qubit.
Matrix representation:
U4 = \begin{bmatrix} u_0 & u_1 \\ u_2 & u_3 \end{bmatrix}
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| VQGate pyqpanda3.core.core.U4 | ( | int | qbit_idx, |
| param1, | |||
| param2, | |||
| param3, | |||
| param4 ) |
U4(*args, **kwargs) Overloaded function.
Apply the U4 gate to a qubit.
Matrix representation:
U4 = \begin{bmatrix} u_0 & u_1 \\ u_2 & u_3 \end{bmatrix}
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.U4 | ( | int | qubit, |
| float | theta, | ||
| float | phi, | ||
| float | _lambda, | ||
| float | gamma ) |
U4(*args, **kwargs) Overloaded function.
Apply the U4 gate to a qubit.
Matrix representation:
U4 = \begin{bmatrix} u_0 & u_1 \\ u_2 & u_3 \end{bmatrix}
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param2 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param3 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| param4 | the fixed param val or mutable param's pos in Parameter which will be used to update the val of the angle |
Apply the U4 gate to a qubit with an angle
| qbit_idx | the idx of qbit which will be appled the P gate |
| param1 | the fixed param's val |
| param2 | the fixed param's val |
| param3 | the fixed param's val |
| param4 | the mutable param's pos in Parameter which will be used to update the val of the angle |
| QGate pyqpanda3.core.core.X | ( | int | qubit | ) |
X(qubit: int) -> core.QGate.
Apply the X gate to a qubit.
Matrix representation:
X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}
| QGate pyqpanda3.core.core.X1 | ( | int | qubit | ) |
X1(qubit: int) -> core.QGate.
Apply the X1 gate to a qubit.
Matrix representation:
X1 = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{i}{\sqrt{2}} \\ -\frac{i}{\sqrt{2}} & \frac{1}{\sqrt{2}} \end{bmatrix}
| QGate pyqpanda3.core.core.Y | ( | int | qubit | ) |
Y(qubit: int) -> core.QGate.
Apply the Y gate to a qubit.
Matrix representation:
Y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}
| QGate pyqpanda3.core.core.Y1 | ( | int | qubit | ) |
Y1(qubit: int) -> core.QGate.
Apply the Y1 gate to a qubit.
Matrix representation:
Y1 = \begin{bmatrix} \frac{1}{\sqrt{2}} & -\frac{1}{\sqrt{2}} \\ \frac{1}{\sqrt{2}} & \frac{1}{\sqrt{2}} \end{bmatrix}
| QGate pyqpanda3.core.core.Z | ( | int | qubit | ) |
Z(qubit: int) -> core.QGate.
Apply the Z gate to a qubit.
Matrix representation:
Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}
| QGate pyqpanda3.core.core.Z1 | ( | int | qubit | ) |
Z1(qubit: int) -> core.QGate.
Apply the Z1 gate to a qubit.
Matrix representation:
Z1 = \begin{bmatrix} \exp\left(-\frac{i\pi}{4}\right) & 0 \\ 0 & \exp\left(\frac{i\pi}{4}\right) \end{bmatrix}