Skip to content

Circuit draw does not differentiate between different control values #367

@Mayank447

Description

@Mayank447
from qutip_qip.circuit import QubitCircuit
from qutip_qip.operations import gates, get_controlled_gate

qc = QubitCircuit(2)
qc.add_gate(gates.CX, 0, 1)
qc.draw()

modified_CX = get_controlled_gate(gates.X, n_ctrl_qubits=1, control_value=0)
qc2 = QubitCircuit(2)
qc2.add_gate(modified_CX, 0, 1)
qc2.draw()
Image Image

Both render the control bit the same, although in the first case the control value is 1, while in the second case control value is 0. Also in case of custom controlled gates, target_gate name should be used while rendering not the controlled gate's name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions