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

Support getting counts, unitary, state vector and snapshot per circuit index. #1005

Closed
jaygambetta opened this issue Oct 2, 2018 · 0 comments
Assignees
Labels
type: feature request New feature or request

Comments

@jaygambetta
Copy link
Member

jaygambetta commented Oct 2, 2018

What is the expected enhancement?

Currently it is not possible to grab the results from a Result object by the index of the circuit/experiment. That is to say the following does not work:

from qiskit import *
circs = []
for k in range(5):
    q = QuantumRegister(2, "q")
    c = ClassicalRegister(2, "c")
    qc = QuantumCircuit(q,c)
    qc.h(q[0])
    qc.cx(q[0], q[1])
    qc.measure(q,c)
    circs.append(qc)

sim = Aer.get_backend('qasm_simulator')
res = execute(circs, sim).result()
res.get_counts(3)
QISKitError: 'No counts for circuit "3"'

It should be possible to do this.

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

No branches or pull requests

3 participants