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

removed quantum program from tomography module #818

Merged
merged 4 commits into from
Aug 24, 2018

Conversation

chriseclectic
Copy link
Member

Summary

Removes dependency on QuantumProgram from the tomography module.

Removed depreciated interface wrapper from qiskit 0.3.

Details

The function create_tomography_circuits now takes as input a quantum circuit object instead of a quantum program and a circuit name string:
create_tomography_circuits(qp, name, ...) ---> create_tomography_circuits(circuit, ...)
build_wigner_circuits(qp, name, ...) ---> build_wigner_circuits(circuit, ...)

It returns a list of quantum circuit objects that may be executed, rather than needing to extract the circuits from a quantum program.

Tests have been updated to new format and pass.

The tutorials for state tomography, process tomography, and wigner tomography will need updating.

Example

# Bell state tomography example

from qiskit import execute, QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.tools.qcvv import tomography as tomo

qr = QuantumRegister(2)
cr = ClassicalRegister(2)
bell = QuantumCircuit(qr, cr, name='Bell')
bell.h(qr[0])
bell.cx(qr[0], qr[1])

tomo_set = tomo.state_tomography_set([0, 1])
tomo_circs = tomo.create_tomography_circuits(bell, qr, cr, tomo_set)
result = execute(tomo_circs, 'local_qasm_simulator', shots=shots, seed=42).result()
data = tomo.tomography_data(result, circuit.name, tomoset)
rho = tomo.fit_tomography_data(data)

✅ I have added the tests to cover my changes.
✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.

ajavadia
ajavadia previously approved these changes Aug 24, 2018
@ajavadia ajavadia merged commit a0592e6 into Qiskit:master Aug 24, 2018
@chriseclectic chriseclectic deleted the tomo-remove-qp branch September 14, 2018 21:07
lia-approves pushed a commit to edasgupta/qiskit-terra that referenced this pull request Jul 30, 2019
* removed quantum program from tomography module, tutorials will need updating

* removing QuantumProgram from dosctrings

* linter

* more linter
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.

2 participants