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.

QubitCircuit.resolve_gates() errors on "FREDKIN" gate.

See original GitHub issue

Describe the bug When applying resolve_gates() method to QubitCircuit containing the FREDKIN gate, the following error is produced:

ValueError: Gate RY requires one target

To Reproduce

from qutip.qip.circuit import QubitCircuit
A = QubitCircuit(3)
A.add_gate("FREDKIN", targets=[0, 1], controls=[2])
A.resolve_gates()

It might be a good idea to check this for other gates as well as look into the internal of resolve_gates to clean/modify it a bit.

Note: As requested by @BoxiLi, first mentioned by me in #1318

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
purva-thakrecommented, Mar 30, 2021

You see, the gate Gate(RY, targets=[0, 1], controls=None) is clearly wrong because RY acts only on one qubits.

Yep ! That’s what I thought as well…for all the single qubit gate outputs with two targets. I knew I was getting an error but was not sure why it was not the same error as both of you. It was because I was using the released version (like you predicted).

I was trying to put off installing from source for as long as I could because I would have to install conda and other dependencies manually. Now, I did get ValuError. Thanks !

0reactions
jakelishmancommented, Apr 13, 2021

Fixed by #1489.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[1603.08086] A quantum Fredkin gate - arXiv
Abstract: Key to realising quantum computers is minimising the resources required to build logic gates into useful processing circuits.
Read more >
Phys. Rev. Lett. 62, 2124 (1989) - Quantum optical Fredkin gate
A simple optical model to realize a reversible, potentially error-free logic gate—a Fredkin gate—is discussed. The device dissipates no ...
Read more >
An Holistic Extension for Classical Logic via Quantum Fredkin ...
An holistic extension for classical propositional logic is introduced in the framework of quantum computation with mixed states.
Read more >
Fredkin gate - Wikipedia
The Fredkin gate (also CSWAP gate and conservative logic gate) is a computational circuit suitable for reversible computing, invented by Edward Fredkin.
Read more >
One-step implementation of a hybrid Fredkin gate with ...
The Fredkin gate is a three-qubit controlled-SWAP gate. ... quantum computation and quantum information processing (QCQIP) such as error correction [2, 3], ...
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