QubitCircuit.resolve_gates() errors on "FREDKIN" gate.
See original GitHub issueDescribe 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:
- Created 3 years ago
- Comments:12 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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 !Fixed by #1489.