QPanda3
0.1.0
Supported by OriginQ
|
Public Member Functions | |
None | __init__ (self, *args, **kwargs) |
Initialize self. | |
QGate | add_control (self, int qubit) |
add_control(self: core.QGate, qubit: int) -> core.QGate | |
None | clear_control (self) |
clear_control(self: core.QGate) -> None | |
QGate | control (self, int qubit) |
control(*args, **kwargs) Overloaded function. | |
QGate | control (self, list[int] controls) |
control(*args, **kwargs) Overloaded function. | |
list[int] | control_qubits (self) |
control_qubits(self: core.QGate) -> list[int] | |
QGate | dagger (self) |
dagger(self: core.QGate) -> core.QGate | |
GateType | gate_type (self) |
gate_type(self: core.QGate) -> core.GateType | |
bool | is_dagger (self) |
is_dagger(self: core.QGate) -> bool | |
numpy.ndarray[numpy.complex128[m, n]] | matrix (self, bool expanded=...) |
matrix(self: core.QGate, expanded: bool = False) -> numpy.ndarray[numpy.complex128[m, n]] | |
str | name (self) |
name(self: core.QGate) -> str | |
list[float] | parameters (self) |
parameters(self: core.QGate) -> list[float] | |
QGate | power (self, float k) |
power(self: core.QGate, k: float) -> core.QGate | |
list[int] | qubits (self) |
qubits(self: core.QGate) -> list[int] | |
int | qubits_num (self) |
qubits_num(self: core.QGate) -> int | |
None | set_parameters (self, list[float] params) |
set_parameters(self: core.QGate, params: list[float]) -> None | |
list[int] | target_qubits (self) |
target_qubits(self: core.QGate) -> list[int] | |
Public Member Functions inherited from pyqpanda3.core.Operation | |
bool | is_controlled (self) |
is_controlled(self: core.Operation) -> bool | |
Additional Inherited Members | |
Static Public Attributes inherited from pyqpanda3.core.Operation | |
list | m_control_qubits [int] |
list | m_measure_cbits [int] |
list | m_target_qubits [int] |
None pyqpanda3.core.QGate.__init__ | ( | self, | |
* | args, | ||
** | kwargs ) |
Initialize self.
See help(type(self)) for accurate signature.
Reimplemented from pyqpanda3.core.Operation.
QGate pyqpanda3.core.QGate.add_control | ( | self, | |
int | qubit ) |
add_control(self: core.QGate, qubit: int) -> core.QGate
Add a control qubit.
qubit | The control qubit index to add. |
None pyqpanda3.core.QGate.clear_control | ( | self | ) |
clear_control(self: core.QGate) -> None
Clear all control qubits from this gate.
QGate pyqpanda3.core.QGate.control | ( | self, | |
int | qubit ) |
control(*args, **kwargs) Overloaded function.
Get a controlled version of this gate with the specified control qubit.
qubit | The control qubit index. |
Get a controlled version of this gate with multiple control qubits.
controls | A vector of control qubit indices. |
QGate pyqpanda3.core.QGate.control | ( | self, | |
list[int] | controls ) |
control(*args, **kwargs) Overloaded function.
Get a controlled version of this gate with the specified control qubit.
qubit | The control qubit index. |
Get a controlled version of this gate with multiple control qubits.
controls | A vector of control qubit indices. |
list[int] pyqpanda3.core.QGate.control_qubits | ( | self | ) |
control_qubits(self: core.QGate) -> list[int]
Get the control qubits for this gate.
QGate pyqpanda3.core.QGate.dagger | ( | self | ) |
dagger(self: core.QGate) -> core.QGate
Get the adjoint (dagger) of this gate.
GateType pyqpanda3.core.QGate.gate_type | ( | self | ) |
gate_type(self: core.QGate) -> core.GateType
Get the type of this gate.
bool pyqpanda3.core.QGate.is_dagger | ( | self | ) |
is_dagger(self: core.QGate) -> bool
Check if this gate is a dagger.
numpy.ndarray[numpy.complex128[m, n]] pyqpanda3.core.QGate.matrix | ( | self, | |
bool | expanded = ... ) |
matrix(self: core.QGate, expanded: bool = False) -> numpy.ndarray[numpy.complex128[m, n]]
Get the matrix representation of this gate.
expanded | Whether to return the expanded matrix. |
str pyqpanda3.core.QGate.name | ( | self | ) |
list[float] pyqpanda3.core.QGate.parameters | ( | self | ) |
parameters(self: core.QGate) -> list[float]
Get the parameters of this gate.
QGate pyqpanda3.core.QGate.power | ( | self, | |
float | k ) |
power(self: core.QGate, k: float) -> core.QGate
Get this gate raised to a power.
k | The exponent to raise this gate to. |
list[int] pyqpanda3.core.QGate.qubits | ( | self | ) |
qubits(self: core.QGate) -> list[int]
Get the target qubits.
int pyqpanda3.core.QGate.qubits_num | ( | self | ) |
qubits_num(self: core.QGate) -> int
Get the number of qubits that this gate acts on.
None pyqpanda3.core.QGate.set_parameters | ( | self, | |
list[float] | params ) |
set_parameters(self: core.QGate, params: list[float]) -> None
Set the parameters for this gate.
params | A vector of parameters to set. |
list[int] pyqpanda3.core.QGate.target_qubits | ( | self | ) |
target_qubits(self: core.QGate) -> list[int]
Get the target qubits for this gate.