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

Changed simulators fallback to decompose_once and removed ancilla support from DensityMatrixSimulator #6127

Merged
merged 5 commits into from Jun 8, 2023

Conversation

tanujkhattar
Copy link
Collaborator

@tanujkhattar tanujkhattar commented Jun 8, 2023

See #6081 (comment) for a detailed description. Tl;Dr is as follows:

  1. Fixed bugs in strat_act_on_from_apply_decompose and SimulationState which were introduced as part of Update Density Matrix and State Vector Simulators to work when an operation allocates new qubits as part of its decomposition #6108
  2. Laid foundations for choosing a custom qubit allocation strategy when simulating circuits containing operations that can allocate new ancillas as part of their decompose protocol.

@tanujkhattar tanujkhattar requested review from a team, vtomole and cduck as code owners June 8, 2023 08:11
@tanujkhattar tanujkhattar changed the title Fix bugs in strat_act_on_from_apply_decompose and improve support for qubit allocation within decompose Fix bugs in strat_act_on_from_apply_decompose and improve support for qubit allocation within decompose Jun 8, 2023
@NoureldinYosri
Copy link
Collaborator

The title of the PR doesn't really match the content of the PR, how about "Changed simulators' fallback to decompose_once and removed ancilla support from DensityMatrixSimulator".

does having DensityMatrixSimulator support ancillas block cirq-ft ?


nit: this PR is 2 in 1: the first a partial reversal of #6108 to remove the ancilla support from DensityMatrixSimulator and the second one contains the changes to strat_act_on_from_apply_decompose. so splitting it might be a good idea.

@tanujkhattar tanujkhattar changed the title Fix bugs in strat_act_on_from_apply_decompose and improve support for qubit allocation within decompose Changed simulators fallback to decompose_once and removed ancilla support from DensityMatrixSimulator Jun 8, 2023
@tanujkhattar
Copy link
Collaborator Author

Updated the title.

does having DensityMatrixSimulator support ancillas block cirq-ft ?

No.

so splitting it might be a good idea

Hmm, I'll let people take a look at it as is for a bit and I can split if it's getting hard to review.

@NoureldinYosri
Copy link
Collaborator

LGTM. pending review from @senecameeks

@tanujkhattar
Copy link
Collaborator Author

@NoureldinYosri Can you LGTM with an approval to merge? I'll ping Seneca separately to take a look in the meantime.

Copy link
Collaborator

@senecameeks senecameeks left a comment

Choose a reason for hiding this comment

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

Reviewed, looks good!

Copy link
Collaborator

@NoureldinYosri NoureldinYosri left a comment

Choose a reason for hiding this comment

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

please update the docstring of add_qubits in simulation_state before you merge

cirq-core/cirq/sim/simulation_state.py Outdated Show resolved Hide resolved
@tanujkhattar tanujkhattar enabled auto-merge (squash) June 8, 2023 18:49
@tanujkhattar tanujkhattar merged commit 0ef302f into quantumlib:master Jun 8, 2023
36 checks passed
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.

None yet

3 participants