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

Can gates in the circuit file be out of order? #74

Closed
95-martin-orion opened this issue Apr 2, 2020 · 1 comment
Closed

Can gates in the circuit file be out of order? #74

95-martin-orion opened this issue Apr 2, 2020 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@95-martin-orion
Copy link
Collaborator

I'm working on a generator for qsim circuits, and for certain gates that qsim does not support it decomposes the gate into a sequence that qsim does support. If there are other gates running at the same time, this can create out-of-order gates in the file, e.g.:

# one input gate
0 rxy 0 0.5 0.25
1 rz 0 0.5
# another input gate
0 cp 1 2 0.75

Is this allowed in qsim or not? Either way, can we update input_format.md to clarify this for users?

(I have no preference for whether we should support this or not - if it's currently not allowed, I can refactor my generator code.)

@95-martin-orion 95-martin-orion added documentation Improvements or additions to documentation question Further information is requested labels Apr 2, 2020
@sergeisakov
Copy link
Collaborator

It depends. Your example will work. However, the following examples will not work:

# one input gate
1 rz 0 0.5
0 rxy 0 0.5 0.25
# another input gate
0 cp 1 2 0.75

or

0 rxy 0 0.5 0.25
2 rz 0 0.5
0 cp 1 2 0.75
1 cz 0 1

That is gates acting on the same qubits must be in ascending order of time. This can be fixed by sorting gates or as you suggested, we can update input_format.md to clarify this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants