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

Statevector snapshot extension #301

Closed
chriseclectic opened this issue Jul 29, 2019 · 0 comments · Fixed by #355
Closed

Statevector snapshot extension #301

chriseclectic opened this issue Jul 29, 2019 · 0 comments · Fixed by #355
Labels
enhancement New feature or request
Milestone

Comments

@chriseclectic
Copy link
Member

chriseclectic commented Jul 29, 2019

What is the expected behavior?

This should have signature

class SnapshotStatevector(Snapshot):
    __init__(self, label, num_qubits):
        super(label, "statevector", num_qubits, 0, None)
 

# Monkey patch function
def snapshot_statevector(self, label, qubits=None):
     # see base snapshot monkey patch for converting qubits to
     # be all qubits in circuit

circuit.snapshot_statevector = snapshot_statevector

The num_qubits parameter is actually ignored by Aer (it is always an all-qubit instruction), however it is used by Terra to make the snapshot act as a barrier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant