Fixing examples with new features (#1292)

* Fixing examples with new features

* Fixing print

* Update
This commit is contained in:
Jay Gambetta 2018-11-19 09:51:48 -05:00 committed by Ali Javadi-Abhari
parent 5a48644396
commit 6a3cbae3a4
2 changed files with 5 additions and 10 deletions

View File

@ -11,7 +11,6 @@ Example showing how to draw a quantum circuit using Qiskit Terra.
"""
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit.tools.visualization import circuit_drawer
def build_bell_circuit():
@ -27,9 +26,5 @@ def build_bell_circuit():
# Create the circuit
bell_circuit = build_bell_circuit()
# Provide a name to write the diagram to the filesystem
circuit_drawer(bell_circuit, filename='./bell_circuit.png')
# Use the return value with show() to display the diagram
diagram = circuit_drawer(bell_circuit)
diagram.show()
# Use the internal .draw() to print the circuit
print(bell_circuit)

View File

@ -63,9 +63,9 @@ qft5.barrier()
for j in range(5):
qft5.measure(q[j], c[j])
print(qft3.qasm())
print(qft4.qasm())
print(qft5.qasm())
print(qft3)
print(qft4)
print(qft5)
###############################################################
# Set up the API and execute the program.