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

Add global phase gate. #579

Merged
merged 2 commits into from
Jan 16, 2023
Merged

Add global phase gate. #579

merged 2 commits into from
Jan 16, 2023

Conversation

sergeisakov
Copy link
Collaborator

No description provided.

@95-martin-orion
Copy link
Collaborator

Before I dig into review: this PR impacts more of qsim than I would have expected. Is this primarily due to adding support for zero-qubit gates, or were there other complications that expanded the change?

@sergeisakov
Copy link
Collaborator Author

Yes, this is due to adding support for zero-qubit gates. Perhaps the only non-trivial change in this PR is addition to the fusers.

@@ -212,6 +220,8 @@ class BasicGateFuser final : public Fuser<IO, Gate> {
gates_lat[gate.qubits[0]].push_back(&gate);
gates_lat[gate.qubits[1]].push_back(&gate);
gates_seq.push_back(&gate);
} else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any case where this else triggers for gates with >2 qubits?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no such a case. The else in line 206 triggers for gates with >2 qubits

}
if (qs.size() == 0) {
IO::errorf(
"error: controlled global phase gate is not implemented %s %d\n",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intended for this PR, planned for a future PR, or not on the roadmap?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not on the roadmap.

@sergeisakov sergeisakov merged commit e73d4f5 into master Jan 16, 2023
@sergeisakov sergeisakov deleted the global-phase-gate branch January 16, 2023 12:06
@rht
Copy link

rht commented Jan 18, 2023

Thank you so much for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants