Skip to content

Support zero-operand instructions in circuit drawers #9962

@jakelishman

Description

@jakelishman

What should we add?

Currently, if there is an operation in a QuantumCircuit that acts on 0 qubits or clbits, it won't be drawn at all by the circuit drawers. Such an operation is well defined, though - all qubits not explicitly acted on by an operation implicitly undergo the identity. The only real use-case we have for this (right now) is the idea of a "global-phase gate" (see #9251), which leads to confusion when trying to visualise the circuit; the zero-operation gate will not be drawn, making it look like the circuit is different to what it actually is.

It would be good to support these operations in the drawers. There might be more ideas, but my first thought was to say that when a zero-operand gate is encountered, it should just be drawn using the normal "box" logic, as if it acts on all the qubits (ideally without the wire input numbers, though if they end up being necessary, it's not the end of the world, I suppose).

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedcommunity contributions welcome. For filters like http://github-help-wanted.com/mod: visualizationqiskit.visualizationtype: feature requestNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions