pyqpanda.Visualization.circuit_info
Show quantum circuit info.
- GateType:
PAULI_X_GATE, /**< Quantum pauli x gate / PAULI_Y_GATE, /**< Quantum pauli y gate */ PAULI_Z_GATE, /**< Quantum pauli z gate */ X_HALF_PI, /**< Quantum x half gate */ Y_HALF_PI, /**< Quantum y half gate */ Z_HALF_PI, /**< Quantum z half gate */ P_GATE, /**<Quantum p gate>/ HADAMARD_GATE, /**< Quantum hadamard gate / T_GATE, /**< Quantum t gate */ S_GATE, /**< Quantum s gate */ RX_GATE, /**< Quantum rotation x gate */ RY_GATE, /**< Quantum rotation y gate */ RZ_GATE, /**< Quantum rotation z gate */ RPHI_GATE, U1_GATE, /**< Quantum u1 gate */ U2_GATE, /**< Quantum u2 gate */ U3_GATE, /**< Quantum u3 gate */ U4_GATE, /**< Quantum u4 gate */ CU_GATE, /**< Quantum control-u gate */ CNOT_GATE, /**< Quantum control-not gate */ CZ_GATE, /**< Quantum control-z gate */ CP_GATE, /**<Quantum control-p gate>/ RYY_GATE, /**<Quantum ryy gate>*/ RXX_GATE, /**<Quantum rxx gate>*/ RZZ_GATE, /**<Quantum rzz gate>*/ RZX_GATE, /**<Quantum rzx gate>*/ CPHASE_GATE, /**< Quantum control-rotation gate */ ISWAP_THETA_GATE, /**< Quantum iswap-theta gate */ ISWAP_GATE, /**< Quantum iswap gate */ SQISWAP_GATE, /**< Quantum sqiswap gate */ SWAP_GATE, /**< Quantum swap gate */ TWO_QUBIT_GATE, /**< Quantum two-qubit gate */ TOFFOLI_GATE, ORACLE_GATE, CORACLE_GATE, I_GATE,
Functions
|
Convert a quantum gate type from the pyQPanda package to its corresponding string representation. |
|
Analyzes the provided quantum circuit and prints detailed information about it. |
Module Contents
- pyqpanda.Visualization.circuit_info.get_gate_name(gate_type: pyqpanda.GateType)[源代码]
Convert a quantum gate type from the pyQPanda package to its corresponding string representation.
- Args:
- gate_type (pq.GateType):
The enum representing the quantum gate type.
- Returns:
- str:
The string name of the quantum gate.
- Raises:
- TypeError:
If an unknown gate type is provided.
Supported gates include Pauli gates, Hadamard, T, S, CNOT, CZ, SWAP, SQISWAP, Toffoli, single-qubit gates, rotation gates, controlled gates, and multi-qubit gates. The function uses the enum values from the pq module to determine the correct string representation of the gate.
- pyqpanda.Visualization.circuit_info.get_circuit_info(circ: pyqpanda.QCircuit) None [源代码]
Analyzes the provided quantum circuit and prints detailed information about it.
The function takes a quantum circuit object and outputs a string containing: - The number of qubits in the circuit. - A map of gate types to their respective counts. - Total number of gates in the circuit. - Count of parameterized gates and total number of parameters across these gates.
- Args:
- circ (pq.QCircuit):
The quantum circuit to analyze.
- Returns:
- None:
This function prints the analysis results directly and does not return a value.