Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

text drawer should be enhanced for multi-qubit gates #1939

Closed
ajavadia opened this issue Mar 9, 2019 · 0 comments
Closed

text drawer should be enhanced for multi-qubit gates #1939

ajavadia opened this issue Mar 9, 2019 · 0 comments
Assignees

Comments

@ajavadia
Copy link
Member

ajavadia commented Mar 9, 2019

What is the expected enhancement?

  1. If I have a two-qubit box/gate and want to apply it to non-adjacent gates, the text drawer raises the following error:
VisualizationError: 'Text visualizaer does know how to build a gate with multiplebits when they are not adjacent to each other'

We just need to indicate/mark those wires that the gate is acting upon, and then it will be clear.

  1. This raises another issue. The order of wires can be different when the gate is applied, so the drawer should reflect that.

So I think we should show something like this:

         ┌─────────┐┌─────────┐
q3_0: |0>┤0        ├┤1        ├
         │ My_gate ││         │
q3_1: |0>┤1        ├┤ My_gate ├
         └─────────┘│         │
q3_2: |0>───────────┤0        ├
                    └─────────┘

Here, "my_gate" is a two-qubit gate, with some internal definition.
It has been added to the circuit like this:

circuit.append(my_gate, [q[0], q[1]])
circuit.append(my_gate, [q[2], q[0]])

Note: this code is possible in PR #1816

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants