mirror of https://github.com/Qiskit/qiskit.git
Fixing examples with new features (#1292)
* Fixing examples with new features * Fixing print * Update
This commit is contained in:
parent
5a48644396
commit
6a3cbae3a4
|
@ -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)
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue