QPanda3
0.1.0
Supported by OriginQ
|
Classes | |
class | CBit |
class | CPUQVM |
class | DAGNode |
class | DAGQCircuit |
class | DensityMatrixSimulator |
class | GateType |
class | GPUQVM |
class | NoiseModel |
class | NoiseOpType |
class | Operation |
class | OpType |
class | PartialAmplitudeQVM |
class | PIC_TYPE |
class | QCircuit |
class | QGate |
class | QMeasure |
class | QProg |
class | QResult |
class | QuantumError |
class | Qubit |
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. | |
tuple[VQGate, list[float|list[int]]] | CP (int control_qbit_idx, int target_qbit_idx, list[int] param) |
CP(*args, **kwargs) Overloaded function. | |
QGate | CR (int control, int target, float theta) |
CR(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | CR (int control_qbit_idx, int target_qbit_idx, list[int] param) |
CR(*args, **kwargs) Overloaded function. | |
QGate | CU (int control, int target, float theta, float phi, float _lambda, float gamma) |
CU(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | CU (int control_qbit_idx, int target_qbit_idx, list[int] param1, float|list[int] param2, float|list[int] param3, float|list[int] param4) |
CU(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | CU (int control_qbit_idx, int target_qbit_idx, float param1, list[int] param2, float|list[int] param3, float|list[int] param4) |
CU(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | CU (int control_qbit_idx, int target_qbit_idx, float param1, float param2, list[int] param3, float|list[int] param4) |
CU(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | CU (int control_qbit_idx, int target_qbit_idx, float param1, float param2, float param3, list[int] param4) |
CU(*args, **kwargs) Overloaded function. | |
QGate | CZ (int qubit1, int qubit2) |
CZ(qubit1: int, qubit2: int) -> core.QGate. | |
QGate | H (int qubit) |
H(qubit: int) -> core.QGate. | |
QGate | I (int qubit) |
I(qubit: int) -> core.QGate. | |
QGate | ISWAP (int qubit1, int qubit2) |
ISWAP(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. | |
tuple[VQGate, list[float|list[int]]] | P (int qbit_idx, list[int] 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. | |
tuple[VQGate, list[float|list[int]]] | RPhi (int qbit_idx, list[int] param1, float|list[int] param2) |
RPhi(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RPhi (int qbit_idx, float param1, list[int] param2) |
RPhi(*args, **kwargs) Overloaded function. | |
QGate | RX (int qubit, float theta) |
RX(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RX (int qbit_idx, list[int] param) |
RX(*args, **kwargs) Overloaded function. | |
QGate | RXX (int control, int target, float theta) |
RXX(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RXX (int control_qbit_idx, int target_qbit_idx, list[int] param) |
RXX(*args, **kwargs) Overloaded function. | |
QGate | RY (int qubit, float theta) |
RY(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RY (int qbit_idx, list[int] param) |
RY(*args, **kwargs) Overloaded function. | |
QGate | RYY (int control, int target, float theta) |
RYY(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RYY (int control_qbit_idx, int target_qbit_idx, list[int] param) |
RYY(*args, **kwargs) Overloaded function. | |
QGate | RZ (int qubit, float theta) |
RZ(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RZ (int qbit_idx, list[int] param) |
RZ(*args, **kwargs) Overloaded function. | |
QGate | RZX (int control, int target, float theta) |
RZX(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RZX (int control_qbit_idx, int target_qbit_idx, list[int] param) |
RZX(*args, **kwargs) Overloaded function. | |
QGate | RZZ (int control, int target, float theta) |
RZZ(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | RZZ (int control_qbit_idx, int target_qbit_idx, list[int] param) |
RZZ(*args, **kwargs) Overloaded function. | |
QGate | S (int qubit) |
S(qubit: 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. | |
tuple[VQGate, list[float|list[int]]] | U1 (int qbit_idx, list[int] param) |
U1(*args, **kwargs) Overloaded function. | |
QGate | U2 (int qubit, float theta, float phi) |
U2(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U2 (int qbit_idx, list[int] param1, float|list[int] param2) |
U2(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U2 (int qbit_idx, float param1, list[int] param2) |
U2(*args, **kwargs) Overloaded function. | |
QGate | U3 (int qubit, float theta, float phi, float _lambda) |
U3(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U3 (int qbit_idx, list[int] param1, float|list[int] param2, float|list[int] param3) |
U3(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U3 (int qbit_idx, float param1, list[int] param2, float|list[int] param3) |
U3(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U3 (int qbit_idx, float param1, float param2, list[int] param3) |
U3(*args, **kwargs) Overloaded function. | |
QGate | U4 (int qubit, float theta, float phi, float _lambda, float gamma) |
U4(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U4 (int qbit_idx, list[int] param1, float|list[int] param2, float|list[int] param3, float|list[int] param4) |
U4(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U4 (int qbit_idx, float param1, list[int] param2, float|list[int] param3, float|list[int] param4) |
U4(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U4 (int qbit_idx, float param1, float param2, list[int] param3, float|list[int] param4) |
U4(*args, **kwargs) Overloaded function. | |
tuple[VQGate, list[float|list[int]]] | U4 (int qbit_idx, float param1, float param2, float param3, list[int] 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. | |
QMeasure | measure (int qubit, int cbit) |
measure(qubit: int, cbit: int) -> core.QMeasure | |
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 | |
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.amplitude_damping_error | ( | float | prob | ) |
amplitude_damping_error(prob: float) -> core.QuantumError
Create an amplitude damping error.
QGate pyqpanda3.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.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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.CP | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | 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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.CR | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | 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.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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.CU | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
float | param1, | ||
float | param2, | ||
float | param3, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.CU | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
float | param1, | ||
float | param2, | ||
list[int] | param3, | ||
float | list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.CU | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
float | param1, | ||
list[int] | param2, | ||
float | list[int] | param3, | ||
float | list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.CU | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | param1, | ||
float | list[int] | param2, | ||
float | list[int] | param3, | ||
float | list[int] | 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.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.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.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.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.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.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.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}
QGate pyqpanda3.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}
QMeasure pyqpanda3.core.measure | ( | int | qubit, |
int | cbit ) |
measure(qubit: int, cbit: int) -> core.QMeasure
Create the QMeasure to a qubit.
QGate pyqpanda3.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.
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.P | ( | int | qbit_idx, |
list[int] | 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.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.pauli_x_error | ( | float | prob | ) |
pauli_x_error(prob: float) -> core.QuantumError
Create a Pauli-X error.
QuantumError pyqpanda3.core.pauli_y_error | ( | float | prob | ) |
pauli_y_error(prob: float) -> core.QuantumError
Create a Pauli-Y error.
QuantumError pyqpanda3.core.pauli_z_error | ( | float | prob | ) |
pauli_z_error(prob: float) -> core.QuantumError
Create a Pauli-Z error.
QuantumError pyqpanda3.core.phase_damping_error | ( | float | prob | ) |
phase_damping_error(prob: float) -> core.QuantumError
Create a phase damping error.
QCircuit pyqpanda3.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. |
QCircuit pyqpanda3.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.RPHI | ( | int | control, |
float | theta, | ||
float | phi ) |
RPHI(control: int, theta: float, phi: float) -> core.QGate.
Apply the RPHI gate to a qubit.
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RPhi | ( | int | qbit_idx, |
float | param1, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RPhi | ( | int | qbit_idx, |
list[int] | param1, | ||
float | list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RX | ( | int | qbit_idx, |
list[int] | 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.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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RXX | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RY | ( | int | qbit_idx, |
list[int] | 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.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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RYY | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RZ | ( | int | qbit_idx, |
list[int] | 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.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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RZX | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | 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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.RZZ | ( | int | control_qbit_idx, |
int | target_qbit_idx, | ||
list[int] | 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.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.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.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.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.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}
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U1 | ( | int | qbit_idx, |
list[int] | 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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U2 | ( | int | qbit_idx, |
float | param1, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U2 | ( | int | qbit_idx, |
list[int] | param1, | ||
float | list[int] | 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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U3 | ( | int | qbit_idx, |
float | param1, | ||
float | param2, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U3 | ( | int | qbit_idx, |
float | param1, | ||
list[int] | param2, | ||
float | list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U3 | ( | int | qbit_idx, |
list[int] | param1, | ||
float | list[int] | param2, | ||
float | list[int] | 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.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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U4 | ( | int | qbit_idx, |
float | param1, | ||
float | param2, | ||
float | param3, | ||
list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U4 | ( | int | qbit_idx, |
float | param1, | ||
float | param2, | ||
list[int] | param3, | ||
float | list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U4 | ( | int | qbit_idx, |
float | param1, | ||
list[int] | param2, | ||
float | list[int] | param3, | ||
float | list[int] | 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 |
tuple[VQGate, list[float | list[int]]] pyqpanda3.core.U4 | ( | int | qbit_idx, |
list[int] | param1, | ||
float | list[int] | param2, | ||
float | list[int] | param3, | ||
float | list[int] | 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.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.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.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.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.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.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.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}