Por Salva de la Puente, PyConES 2016
Por Raul Cumplido, PyConES 2016
This is how a quantum experiment looks alike in Qiskit:
from qiskit import *
def bell():
qr = QuantumRegister(2)
cr = ClassicalRegister(2)
qc = QuantumCircuit(qr, cr)
qc.h(qr[1])
qc.cnot(qr[1], qr[0])
qc.measure(qr, cr)
return qc
result = execute(qc, backend='local_qasm_simulator').result()
result.get_counts()
# will print {'counts': {'00': 534, '11': 490}}
Clear but verbose.
How about a specific language for creating circuits?
# in circuits.crc
crc bell q[2] -> c[2]:
- :h: q1
- q1 :cx: q0
end
More succint and funnier to write...