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

Timeout on GPGraph construction in GreedyPauliSimp #1706

Merged
merged 15 commits into from
Dec 5, 2024

Conversation

sjdilkes
Copy link
Contributor

@sjdilkes sjdilkes commented Dec 2, 2024

GPGraph construction and GPGraph::get_sequence can run significantly longer than the given timeout. This PR updates greedy_pauli_graph_synthesis_flag to check timeout during the execution of these methods and to finish early if the timeout is met.

Related issues

Please mention any github issues addressed by this PR.

Checklist

  • I have performed a self-review of my code.
  • I have commented hard-to-understand parts of my code.
  • I have made corresponding changes to the public API documentation.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have updated the changelog with any user-facing changes.

@sjdilkes sjdilkes marked this pull request as ready for review December 2, 2024 12:52
@sjdilkes sjdilkes requested a review from cqc-alec December 5, 2024 08:01
.apply(d));
REQUIRE(Transforms::greedy_pauli_optimisation(
0.7, 0.3, 500, 500, 0, true, 10, 10)
0.7, 0.3, 500, 500, 0, true, 10000, 10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we should make the tests take much longer. I suggest removing the test with the long timeout (or annotating it with [.long] so that it doesn't run by default.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done! I've changed the loop size to make the circuit a 1/5 of the size

/** Construct an GPGraph from the circuit size */
GPGraph(qubit_vector_t qubits, bit_vector_t bits);

GPGraph get_graph(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you document what this function does?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, that method shouldn't even be there & is a leftover from an alternative way I considered doing this. I've removed it!

@sjdilkes sjdilkes requested a review from cqc-alec December 5, 2024 12:24
@sjdilkes sjdilkes merged commit e13ed26 into main Dec 5, 2024
32 checks passed
@sjdilkes sjdilkes deleted the add-timeout-to-graph-construction branch December 5, 2024 13:52
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.

2 participants