I am looking the way How to create Entanglement, Superposition and interference? Can someone help to show how to code in qiskit? and the docs related to these mentioned above?
Thanks
I am looking the way How to create Entanglement, Superposition and interference? Can someone help to show how to code in qiskit? and the docs related to these mentioned above?
Thanks
Here you go
from qiskit import * # importing qiskit
# instead of importing everything you could import things separately
def circ_superposition(number):
# raising errors
try:
number = int(number)
except:
return "Number must be an integer"
circ = QuantumCircuit(number, number) # creating the circuit
for i in range(number):
circ.h(i)
return circ
You might want to use the below to see the circuit
print(f'{circ_superposition(6)}') # add any integer in place of 6
and to create entanglement do the following
entanglement = QuantumCircuit(n, n) # replace n by any integer
# apply h gates the qubits
for i in range(n): # replace n by any integer
entanglment.h(i)
# apply cx gate
entanglement.cx(control, target) # replace control and target by control qubit and target qubit respectively
from further assistance refer to: Circuit Basics And Getting Stared With Qiskit
Also consider visiting: Super Dense Coding And Quantum Teleportation for applications of Quantum Interference.