question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add visualization of open controlled gates [text drawer]

See original GitHub issue

In PR #3739, open controlled gates were implemented. With that PR a new keyword argument was added to specify the control state,

XGate().control(3, ctrl_state=6)

This creates a 4 qubit gate where the first three qubits are controls and the fourth qubit is the target where the x-gate may be applied. A ctrl_state may alternatively be expressed as an integer string,

XGate().control(3, ctrl_state='110')

where it is more apparent which qubits are open and closed. In this case when q[0] is open and q[1] and q[2] are closed the x-gate will be applied to q[4].

What is the expected behavior?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ewinstoncommented, Feb 19, 2020

q_0 should be open and q_2 and q_3 closed.

0reactions
1ucian0commented, Mar 11, 2020

I find very confusing that

...control(3, ctrl_state='110'), [qr[0], qr[3], qr[2], ...
                          ^^^      ^      ^      ^
                          ||\------/      |      |
                          |\--------------/      |
                          \----------------------/
Read more comments on GitHub >

github_iconTop Results From Across the Web

add visualization of open controlled gates [mpl drawer] · Issue ...
ewinston says in #3864: In PR #3739, open controlled gates were implemented. With that PR a new keyword argument was added to specify...
Read more >
Visualizing a Quantum Circuit - Qiskit
A text output is useful for quickly seeing the output while developing a circuit, but it doesn't provide the most flexibility in its...
Read more >
Build, edit, and inspect quantum circuits
To visualize the state of all qubits at any point in your circuit, drag the phase disk icon from the operations catalog and...
Read more >
Stepping into World of Quantum Computing: QC Basics With ...
Add gates ; Visualize the circuit; Simulate the experiment; Visualize the results. Step 1: Import Packages. The basic elements needed for your program...
Read more >
Code Quality - GitLab Docs
Uses plugins supported by Code Climate, which are free and open source. ... Having proper access control policies mitigates this attack vector by...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found