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

Fix bug for circuit with selected measurement result #167

Merged
merged 2 commits into from
Sep 8, 2022

Conversation

BoxiLi
Copy link
Member

@BoxiLi BoxiLi commented Sep 7, 2022

The parameter measure_results was not correctly processed in QubitCircuit.run because the Simulator is initialized twice. This commit removes the parameters state, cbits and measure_results from the __init__ of CircuitSimulator and only initializes the simulator before it is run.

The CircuitSimulator class should only include information about the circuit while the information about the state is only provided when running the simulation.

Fix #164

The parameter measure_results was not correctly processed in QubitCircuit.run because the Simulator is initialized twice. This commit removes the parameters state, cbits and measure_results from the __init__ of CircuitSimulator and only initialize the simulator before it is run.

The CircuitSimulator class should only include information about the circuit while the information about the state is only provided when running the simulation.
Copy link
Contributor

@hodgestar hodgestar left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this Boxi. Looks perfect to me.

@BoxiLi BoxiLi merged commit d6e4d52 into qutip:master Sep 8, 2022
@BoxiLi BoxiLi added this to the qutip-qip-0.2.3 milestone Sep 11, 2022
BoxiLi added a commit to BoxiLi/qutip-qip that referenced this pull request Oct 23, 2022
* Fix bug for circuit with selected measurement result

The parameter measure_results was not correctly processed in QubitCircuit.run because the Simulator is initialized twice. This commit removes the parameters `state`, `cbits` and `measure_results` from the `__init__` of CircuitSimulator and only initializes the simulator before it is run.

The CircuitSimulator class should only include information about the circuit while the information about the state is only provided when running the simulation.
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.

Circuit.run ignores supplied measure_results.
2 participants