mindquantum.device.QubitNode
- class mindquantum.device.QubitNode(qubit_id: int, color: str = '#000000', poi_x: float = 0.0, poi_y: float = 0.0)[source]
Qubit node.
A qubit node has a id, a position and a color (if you want to draw it). You can connect two qubits with '>>' or '<<' and disconnect two qubits with '<' or '>'.
- Parameters
Examples
>>> from mindquantum.device import QubitNode >>> q0 = QubitNode(0) >>> q1 = QubitNode(1) >>> q = q0 << q1 >>> q0.qubit_id == q.qubit_id True
- set_color(color: str)[source]
Set the color of this qubit.
- Parameters
color (str) – The new color.
Examples
>>> from mindquantum.device import QubitNode >>> q0 = QubitNode(1) >>> q0.set_color('#ababab') >>> q0.color '#ababab'