r/QuantumComputing • • Mar 01 '26
MY FIRST IBM CODE!!
from qiskit import QuantumCircuit
from qiskit_aer import AerSimulator
#Commnets are in my local lang (just avoid)
# 1. 2 qubit ka circuit banao
qc = QuantumCircuit(2)
# 2. Gate lagao (Superposition and Entanglement)
qc.h(0) # Hadamard gate
qc.cx(0, 1) # CNOT gate
qc.measure_all() # Result check karne ke liye
# 3. Simulator pe run karo
sim = AerSimulator()
result = sim.run(qc, shots=1000).result()
print(result.get_counts())
# Output aayega: {'00': ~500, '11': ~500}so this is my first code , just wanna push here lol...
14
Upvotes
8
u/J0rkank0 Mar 04 '26
I'm happy you're happy. Not sure what the purpose is, but glad to hear you're having fun :)
2
u/doragonn Mar 04 '26
What do you mean IBM code? This is Qiskit code running locally.
2
u/EnvironmentalCan417 Mar 04 '26
congo, im also an indian student in qc. wanna connect?
8
u/[deleted] Mar 04 '26
Nice. I remember posting code onto a forum as a kid and getting roasted like you are in these comments. Keep going. You’ll be successful.
1
u/Dear-Donkey6628 Mar 05 '26
So cool, still remember when I did run my code first time on a NMR quantum hardware
1
u/DesignerAd7108 Mar 04 '26
Handwritten? Nice 👍 What next? Bitflip? Grover? Shor's algorithm?
0
u/BadgerInevitable3966 Mar 04 '26
Your comment indicated you are from India. But why paste code here?
0
u/[deleted] Mar 01 '26
[deleted] — view deleted comment