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.

Instruction should include qubits it acts on

See original GitHub issue

What is the expected enhancement?

Qiskit currently lacks a class to represent the concept “a gate together with the qubits it acts on.” This concept is useful because it is the basic unit a quantum circuit is composed of. For example, it can be the type of object appended to a circuit, so that QuantumCircuit.append can accept a single argument instead of multiple. It can also be used to simplify circuit construction in other ways; for example, circuit = QuantumCircuit(instructions) where instructions is an iterable of instructions (in fact it could be an “iterable tree” of instructions). After some discussion with @ajavadia we agree that the Instruction class could be updated to serve this purpose.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
kevinsungcommented, Mar 17, 2022

Thanks @jakelishman, it’s good to know there is work being done on this front. In circuit = QuantumCircuit(instructions) I meant that instructions could have type Iterable[Instruction] where Instruction is the (proposed) class that represents “gate + qubits” which does not actually exist in Qiskit currently. By “iterable tree” I meant that it could in fact be a recursive type InstructionTree = Union[Instruction, Iterable[InstructionTree]] because this can be flattened into a list of instructions. The qubit ordering wouldn’t be an issue if the user refers to the qubits directly rather than by index.

0reactions
jakelishmancommented, Nov 25, 2022

Closing this as it’s not the direction that’s been taken for the data model, because we’re separating the concept of “operation” (Instruction, in this case) from its runtime operands (qubits, clbits, some parameters, etc). This is to keep better composibility throughout the library, which will (hopefully) be helping our internal memory usage and avoid a lot of spurious copying in the library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Quantum Instruction Set - Computerphile - YouTube
Just what can you do with a quantum computer? Robert Smith of Rigetti Computing takes us through his quantum instruction set.
Read more >
Quantum Computing Lecture 1 Bits and Qubits What is ...
Aim to use quantum mechanical phenomena that have no classical counterpart for computational purposes. Central research tasks include: • Building devices — with ......
Read more >
Qubits and Defining the Quantum Computer | HowStuffWorks
Qubits represent atoms, ions, photons or electrons and their respective control devices that are working together to act as computer memory and a...
Read more >
Creating the Heart of a Quantum Computer: Developing Qubits
To create a qubit, scientists have to find a spot in a material where they can access and control these quantum properties. Once...
Read more >
A Practical Quantum Instruction Set Architecture - arXiv
Abstract—We introduce an abstract machine archi- tecture for classical/quantum computations—including compilation—along with a quantum instruction lan-.
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