quantumlib / Cirq

A Python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits.
Apache License 2.0
4.28k stars 1.02k forks source link

should circuits using symbols suggest that the user implement flattening? #2534

Closed peterse closed 3 years ago

peterse commented 5 years ago

Would it make sense for a param resolver containing many sympy expressions to warn the user of potential slowdowns and point the user towards the flattening utilities?

Looking at @dstrain115's fix in #1899 (comment) a user can potentially improve the simulation time of circuits containing symbols by orders of magnitude using flattening utilities from study.flatten_expressions. I was unaware of this until recently, and I imagine general users may be puzzled by the slowdown incurred by (un-flattened) sympy parameterization.

dabacon commented 4 years ago

Is there a reason we shouldn't just flatten for users? User has original parameters and circuits with formulas. We calculate new parameters where there are no formulas. Use that for simulation or execution. All user cares about is associating original parameters with these results, or am I missing something?

balopat commented 4 years ago

Discussed at Cirq Cynque:

peterse commented 4 years ago

Yea its worth checking whether flattening makes as much of a difference after #3205

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days

github-actions[bot] commented 3 years ago

Issue closed due to inactivity.