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

Better support for controlled gates in text drawer #3771

Merged
merged 17 commits into from
Jan 31, 2020
Merged

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Jan 30, 2020

Fixes #3546

Example:

ghz_circuit = QuantumCircuit(3, name='ghz')
ghz_circuit.h(0)
ghz_circuit.cx(0, 1)
ghz_circuit.cx(1, 2)
ghz = ghz_circuit.to_gate()
ccghz = ghz.control(3)
circuit = QuantumCircuit(8)
circuit.append(ccghz, [0, 2, 6, 1, 4, 3])
q_0: |0>───■────
        ┌──┴───┐
q_1: |0>┤0     ├
        │      │
q_2: |0>■      ├
        │  Ghz │
q_3: |0>┤2     ├
        │      │
q_4: |0>┤1     ├
        └──┬───┘
q_5: |0>───┼────
           │
q_6: |0>───■────

q_7: |0>────────

@1ucian0 1ucian0 marked this pull request as ready for review January 31, 2020 22:16
@1ucian0 1ucian0 added this to the 0.12 milestone Jan 31, 2020
@mergify mergify bot merged commit ff6b941 into Qiskit:master Jan 31, 2020
faisaldebouni pushed a commit to faisaldebouni/qiskit-terra that referenced this pull request Aug 5, 2020
* instruction.op.num_ctrl_qubits

* controlled_wires for knowing if controlled qubits sholud be at the edge

* in, out, rest

* OnWireMid with control_label

* order in the paramenters

* Qiskit#3546 test

* lint

* failing test

* improve the connector

* test control on top and bot

* connectors to multibox, hackish

* failing test

* fix

* lint

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

Successfully merging this pull request may close these issues.

Display of controlled composite gates appears incorrect.
2 participants