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

Adds target kwarg to tomography init #1025

Merged
merged 2 commits into from
Jan 25, 2023

Conversation

chriseclectic
Copy link
Collaborator

@chriseclectic chriseclectic commented Jan 25, 2023

Summary

Closes #994

Updates State and process tomography experiments to directly set the target option for TomographyAnalysis rather than pass it through experiment data metadata.

Details and comments

This allows specifying a custom target for analysis when initializing the experiments. If set to None automatic target calculation is disabled.
@chriseclectic chriseclectic added the Changelog: New Feature Include in the "Added" section of the changelog label Jan 25, 2023
@chriseclectic chriseclectic added this to the Release 0.5 milestone Jan 25, 2023
Copy link
Collaborator

@wshanks wshanks left a comment

Choose a reason for hiding this comment

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

Nice, looks good.

The one thing you could add is a test of passing a non-None target. That would mostly be to protect against a future code change breaking the feature since it is pretty clear it would work fine with the current code.

One question about #994 -- I think the original problem was the user passing a circuit already mapped to high qubit number. Is there any way to invoke the simulator so that it ignores the idle qubits and could simulate qubits 16 and 17 without using 2**17 by 2**17 matrices?

releasenotes/notes/tomography-b091ce13d6983bc1.yaml Outdated Show resolved Hide resolved
Copy link
Collaborator

@wshanks wshanks left a comment

Choose a reason for hiding this comment

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

I guess I shouldn't approve when the linter is failing.

test/library/tomography/test_process_tomography.py Outdated Show resolved Hide resolved
test/library/tomography/test_state_tomography.py Outdated Show resolved Hide resolved
@chriseclectic
Copy link
Collaborator Author

chriseclectic commented Jan 25, 2023

@wshanks Its possible, but more work so I skipped it for now. When permuting the circuit based on the measurement and preparation qubits you could trim any uncoupled ancilla qubits before simulating the statevector/unitary, rather than simulate them all and trace them out at the end. If I get time before release I might try and implement that.

@chriseclectic chriseclectic merged commit 47fa9f7 into qiskit-community:main Jan 25, 2023
chriseclectic added a commit to chriseclectic/qiskit-experiments that referenced this pull request Jan 26, 2023
This allows specifying a custom target for analysis when initializing the experiments. If set to None automatic target calculation is disabled.

Co-authored-by: Will Shanks <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow StateTomography to avoid simulating the input circuit
2 participants