-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Initilize instruction does not write a QASM definition #6169
Comments
A point to note about this is that the |
Is |
I don't see a reason why it should not be.
…On Sat, Apr 17, 2021, 2:14 AM Luciano Bello ***@***.***> wrote:
Is initialized supported by OpenQASM2?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#6169 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEL4NAFMX2SXU62K62SIWRLTJFGNRANCNFSM42PB6BWA>
.
|
I mean, they could as opaque instructions (one per each size of idlist) OPENQASM 2.0;
include "qelib1.inc";
opaque initialize4_2(x0, x1, x2, x3) q0, q1;
qreg q[2];
initialize4_2(0,1,0,0) q[0],q[1]; However this wont make it loadable per se (an opaque instruction wont have a definition). Am I missing something? |
I think the big problem with supporting
in the Qiskit Terra API Documentation. This sort of thing cannot easily be represented within the limited parameter expression syntax of OpenQASM 2.0 |
Thank you @jwoehr and @1ucian0 . |
Well, I've got a working OpenQASM 2 translator based on the ANTLR4 grammar for OpenQASM 3. It's pretty easy to extend, but I'm not sure how much I can get away with on the current PR.. Currently I'm working on the test suite. The next thing I was thinking to add is parameterization of translation so .qasm files can be re-used. Somewhere along the line I should be able to add |
@jwoehr what would I do without you? |
We'll have to see if this PR flies. OpenQASM 3 is a profoundly more complex environment; I'm just using a grammar file authored by the Qiskit team on the basis of OpenQASM 3: A broader and deeper quantum assembly language. As the language evolves I may have to subset that grammar to keep this OpenQASM 2 development manageable. However, it's possible that instead we will move towards an "OpenQASM 2.1, 2.2 ..." which will migrate in stages towards OpenQASM 3. |
Information
when building a quantum circuit from qasm: if the qasm code includes
initialize
it gets ignored (or throws an error).Qiskit | 0.24.1
-- | --
Terra | 0.16.4
Aer | 0.7.6
Ignis | 0.5.2
Aqua | 0.8.2
IBM Q Provider | 0.12.2
Python | 3.8.8
Steps to reproduce the problem
The text was updated successfully, but these errors were encountered: