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

Create intermediate Representation by QASM #7

Open
sah4ez opened this issue Sep 27, 2019 · 3 comments
Open

Create intermediate Representation by QASM #7

sah4ez opened this issue Sep 27, 2019 · 3 comments
Labels
WIP work in progress

Comments

@sah4ez
Copy link
Collaborator

sah4ez commented Sep 27, 2019

Exist several specification of Quantum Assembly Languages, as example:
https://github.com/Qiskit/openqasm
https://github.com/rigetti/quil
https://arxiv.org/pdf/1805.09607.pdf
so, need create an intermediate representation of quantum language, which will loading from human-redable format to binary data and simulation or execute on real QPU.

@sah4ez sah4ez added this to the single process qvm milestone Sep 27, 2019
@sah4ez
Copy link
Collaborator Author

sah4ez commented Sep 27, 2019

As example, we can send to interpreter this command:

H 0
CNOT 0 1
MEASURE 0 1

this algorithm of Bell state.
So we should this commands load to some runtime, and apply this commands on register.
First apply Hadamard gate on 0 register,
Second apply C-NOT gate on 0 -> 1,
And the last to measure state of qubits.
After this we should have 0,0 or 1, 1 values for qubits.

@sah4ez sah4ez added the help wanted Extra attention is needed label Oct 3, 2019
@sah4ez
Copy link
Collaborator Author

sah4ez commented Oct 6, 2019

Equivalent of command in prev comment in golang using register commands:

r := Register(2)
m := r.Apply(H(),1).Apply(CNOT(),2,1).Measure()
// m[0] = |0> -> m[1] = |0>
// or
// m[0] = |1> -> m[1] = |1>

@sah4ez
Copy link
Collaborator Author

sah4ez commented Oct 7, 2019

Need create AST for Intermediate Representation (IR) and create a parser and a lexer for the each of implementations QASM, which will be parse source code in IR and execute on simulator or real QPU.

@sah4ez sah4ez added WIP work in progress and removed help wanted Extra attention is needed labels Jan 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WIP work in progress
Projects
None yet
Development

No branches or pull requests

1 participant