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

Refactor/qcir flexible gate type #83

Merged
merged 5 commits into from
Mar 7, 2024

Conversation

JoshuaLau0220
Copy link
Collaborator

@JoshuaLau0220 JoshuaLau0220 commented Mar 6, 2024

Check List

  1. Does your submission pass tests by running make test?
  2. If you have specified a [no ci] tag, does your submission also pass tests by running make test-docker?
  3. Have you linted your code locally with make lint before submission?

Added

  • qcir::QCir::calculate_gate_times() to replace qcir::QCirGate::get_time()
  • qcir::QCir::append(GateType, QubitIdList)
  • qcir::QCir::prepend(GateType, QubitIdList)

Changed

  • qcir::QCir::get_gates() now also returns a topologically sorted list to prevent confusion caused by multiple get-gates APIs.
  • qcir::QCir::get_gate(size_t id) now returns the gate in $O(1)$.
  • qcir::QCir now automatically maintains its topological gate orders---The user no longer need to update it manually.
  • Extraction now outputs $P$ gates rather than $R_Z$ gates. This is to reduce clutteredness in the code.

Fixed

  • Tableau and Duostra not reading gates in the topological order
  • qcir::QCir not freeing the memory it allocates correctly
  • qcir::Optimizer not freeing the memory it allocates correctly

Removed

  • qcir::QCirGate::get_time(): the info it returns is always unreliable.
  • qcir::QCirGate's traversal pin members.
  • qcir::QCir::get_topologically_ordered_gates() and other topological order-related features: rendered useless with the above changes

@JoshuaLau0220 JoshuaLau0220 requested a review from chinyi0523 March 6, 2024 18:56
@chinyi0523 chinyi0523 merged commit 974d48e into develop Mar 7, 2024
4 checks passed
@JoshuaLau0220 JoshuaLau0220 mentioned this pull request Mar 7, 2024
9 tasks
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