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

[TCirc] Define and implement circuit description language for tcirc #44

Open
Phionx opened this issue Aug 22, 2021 · 2 comments
Open

[TCirc] Define and implement circuit description language for tcirc #44

Phionx opened this issue Aug 22, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Phionx
Copy link
Member

Phionx commented Aug 22, 2021

We need a way to uniquely represent tcirc components (e.g. single/multi qubit gates, readout, etc).

Among other use cases, this is essential for properly decoding the a tcirc readout string.

Some potential resources include:

@Phionx
Copy link
Member Author

Phionx commented Oct 23, 2021

As discussed @jeffreyjgong, one option is to store a list of self.gates = [] in ToplogicalCircuit. This will help you keep track of the gates in the circuit.

Then, for printing the logical quantum circuit, you can either create another Qiskit QuantumCircuit that is equivalent to the logical quantum circuit, and print that out OR you can create your own circuit printing utility.

An example of adding an X gate and also tracking it in self.gates = []:

def x(self, tqubit_indx):
    self.treg[tqubit_indx].x()
    self.gates.append(("x", (tqubit_indx,))

However, this approach may not be extensible to decoding tcirc output, which is another use case for this circuit description language.

@Phionx
Copy link
Member Author

Phionx commented Jan 8, 2022

I think we can store a list of tuples of type Tuple[qiskit.circuit.instruction.Instruction, List[qiskit.circuit.quantumregister.Qubit]] in self.gates, which can then be used for use cases such as drawing the logical circuit.

@Phionx Phionx self-assigned this Jan 8, 2022
@Phionx Phionx modified the milestones: 0.2.0, 0.2.1 Mar 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants