์๋ณด๋ฉด ์ํด ์์ ์ปดํจํฐ ์๋ฆฌ ๋ง์คํฐ ํฌํผ ๋์์ด ๋ก๋ด ์์๋ณด๊ธฐ Don’t miss this! A helpful robot guide that makes mastering the principles of quantum computing super easy.
์์์ปดํจํฐ
๋ง์คํฐ ํฌํผ
๊ธฐ์ด๋ถํฐ ๋ง์คํฐ๊น์ง, ์ฌ๋ฏธ์๊ณ ์ฝ๊ฒ ๋ฐฐ์ฐ๋
์ธํฐ๋ํฐ๋ธ ์์์ปดํจํ
ํ์ต ํ๋ก๊ทธ๋จ
๊ธฐ์ด ๊ฐ๋ — ์์์ญํ์ ํ ๋
ํ๋นํธ, ์ค์ฒฉ, ์ฝํ์ Qiskit ์ฝ๋ ์์์ ํจ๊ป ์ฝ๊ฒ ๋ฐฐ์๋ด์!
✨ ํ๋นํธ ์ํ๋ฅผ ๋ํ๋ด๋ ๋ธ๋กํ ๊ตฌ — ๋ง์ฐ์ค๋ก ๋๋ ค๋ณด์ธ์!
๐ต ํ๋นํธ(Qubit): ๊ณ ์ ๋นํธ(0 ๋๋ 1)์ ๋ฌ๋ฆฌ 0๊ณผ 1์ ๋์์ ๊ฐ์ง ์ ์๋ ์์ ์ ๋ณด ๋จ์์์.
๐ ์ค์ฒฉ(Superposition): ๊ด์ธก ์ ์ ํ๋นํธ๊ฐ 0๊ณผ 1์ ์ํ๋ฅผ ๋์์ ๊ฐ์ง๋ ํ์. Hadamard ๊ฒ์ดํธ๋ก ๋ง๋ค์ด์.
๐ ์ฝํ(Entanglement): ๋ ํ๋นํธ๊ฐ ์๋ก ์ฐ๊ฒฐ๋์ด, ํ๋๋ฅผ ์ธก์ ํ๋ฉด ๋๋จธ์ง ์ํ๋ ์ฆ์ ๊ฒฐ์ ๋ผ์. ์๋ฌด๋ฆฌ ๋ฉ์ด๋์!
# ํ๋นํธ ์ค์ฒฉ + ์ฝํ ์์ from qiskit import QuantumCircuit, transpile from qiskit_aer import AerSimulator # 2-ํ๋นํธ ํ๋ก ์์ฑ qc = QuantumCircuit(2, 2) # ํ๋นํธ 0์ Hadamard → ์ค์ฒฉ ์ํ qc.h(0) # |0⟩ → (|0⟩+|1⟩)/√2 # CNOT → ์ฝํ ์์ฑ (๋ฒจ ์ํ) qc.cx(0, 1) # |00⟩+|11⟩ ๋ฒจ ์ํ! # ์ธก์ qc.measure([0,1], [0,1]) # ์๋ฎฌ๋ ์ดํฐ ์คํ (1024๋ฒ) sim = AerSimulator() result = sim.run(qc, shots=1024).result() counts = result.get_counts() print("์ธก์ ๊ฒฐ๊ณผ:", counts) # → {'00': ~512, '11': ~512} 50:50!
๐ฏ Hadamard (H) ๊ฒ์ดํธ: ํ๋นํธ๋ฅผ ์ค์ฒฉ ์ํ๋ก ๋ง๋๋ ๋ง๋ฒ ๊ฒ์ดํธ!
|0⟩ → (|0⟩ + |1⟩)/√2 |1⟩ → (|0⟩ − |1⟩)/√2
๐ CNOT ๊ฒ์ดํธ: ์ ์ด ํ๋นํธ(control)๊ฐ |1⟩์ด๋ฉด ๋์ ํ๋นํธ(target)๋ฅผ ๋ค์ง์ด์.
์ฝํ ์์ฑ์ ํต์ฌ ๊ฒ์ดํธ!
๐ฎ ๊ฒ์ดํธ ์ธํฐ๋ํฐ๋ธ ๋ฐ๋ชจ
๐พ ๊ณ ์ ๋นํธ: ํญ์ 0 ๋๋ 1. ํ ๋ฒ์ ํ๋์ ์ํ๋ง.
⚛️ ํ๋นํธ n๊ฐ: ๋์์ 2โฟ๊ฐ์ ์ํ ์ฒ๋ฆฌ ๊ฐ๋ฅ!
300๊ฐ ํ๋นํธ = ์ฐ์ฃผ์ ์์ ์๋ณด๋ค ๋ง์ ๊ฒฝ์ฐ์ ์ ๐คฏ
import random # ๊ณ ์ ๋๋ค ๋นํธ (์์ฌ๋์) classical_bits = [random.choice([0, 1]) for _ in range(8)] print(f"๊ณ ์ 8๋นํธ: {classical_bits}") print(f"ํํ ๊ฐ๋ฅ ์ํ: ๋์ 1๊ฐ์ง") # ์์ ์๋ฎฌ๋ ์ด์ from qiskit import QuantumCircuit from qiskit_aer import AerSimulator from qiskit.visualization import plot_histogram n_qubits = 8 qc = QuantumCircuit(n_qubits, n_qubits) # ๋ชจ๋ ํ๋นํธ๋ฅผ ์ค์ฒฉ ์ํ๋ก for i in range(n_qubits): qc.h(i) # 8ํ๋นํธ = 256๊ฐ์ง ๋์ ์ฒ๋ฆฌ! qc.measure_all() sim = AerSimulator() counts = sim.run(qc, shots=256).result().get_counts() print(f"\n์์ 8ํ๋นํธ ์ธก์ ๊ฒฐ๊ณผ: {len(counts)}๊ฐ์ง") print(f"์ด๋ก ์ ๋์ ์ฒ๋ฆฌ: 2^8 = {2**8}๊ฐ์ง ์ํ!") plot_histogram(counts)
❓์ค์ฒฉ(Superposition) ์ํ์ ๋ํ ์ฌ๋ฐ๋ฅธ ์ค๋ช ์?
ํ๊ฒฝ ์ค์ — ์ค์ต ์ค๋น
Qiskit ์ค์น๋ถํฐ IBM Quantum ํด๋ผ์ฐ๋ ์ฐ๊ฒฐ๊น์ง ๋จ๊ณ๋ณ๋ก ์์๋ด์!
๐ ์ค์น ์์: Python 3.9+ → pip → Qiskit → Jupyter → Qiskit Aer (์๋ฎฌ๋ ์ดํฐ)
# 1. Python ๊ฐ์ํ๊ฒฝ ์์ฑ (๊ถ์ฅ) python -m venv quantum-env source quantum-env/bin/activate # Mac/Linux quantum-env\Scripts\activate # Windows # 2. Qiskit ์ ์ฒด ์ค์น pip install qiskit[all] pip install qiskit-aer # ๋ก์ปฌ ์๋ฎฌ๋ ์ดํฐ pip install qiskit-ibm-runtime # IBM ํด๋ผ์ฐ๋ ์ฐ๋ pip install jupyter matplotlib # ์๊ฐํ pip install pylatexenc # ํ๋ก ๊ทธ๋ฆฌ๊ธฐ # 3. Jupyter ์คํ jupyter notebook # 4. ์ค์น ํ์ธ python -c "import qiskit; print(qiskit.__version__)"
๐ IBM Quantum ๋ฌด๋ฃ ํฐ์ด: 127ํ๋นํธ Eagle ํ๋ก์ธ์๋ฅผ ๋ฌด๋ฃ๋ก ์ฌ์ฉ ๊ฐ๋ฅ!
1. quantum.ibm.com ํ์๊ฐ์
→ API ํค ๋ฐ๊ธ
2. Python์ผ๋ก ์ค์ ์์ ์ปดํจํฐ์ ์์
์ ์ก!
from qiskit_ibm_runtime import QiskitRuntimeService from qiskit import QuantumCircuit # 1ํ๋ง ์คํ (API ํค ์ ์ฅ) QiskitRuntimeService.save_account( channel="ibm_quantum", token="YOUR_API_TOKEN_HERE", # ๋ฌด๋ฃ ๋ฐ๊ธ! set_as_default=True ) # ์๋น์ค ๋ก๋ service = QiskitRuntimeService() # ๊ฐ์ฅ ์กฐ์ฉํ (ํ๋นํธ ์ค๋ฅ ์ ์) ๋ฐฑ์๋ ์ ํ backend = service.least_busy( operational=True, min_num_qubits=5 ) print(f"์ ํ๋ ์์ ์ปดํจํฐ: {backend.name}") print(f"ํ๋นํธ ์: {backend.num_qubits}") # ๋ฒจ ์ํ ํ๋ก qc = QuantumCircuit(2, 2) qc.h(0); qc.cx(0, 1); qc.measure_all() # ์ค์ ์์ ํ๋์จ์ด ์คํ! from qiskit_ibm_runtime import SamplerV2 sampler = SamplerV2(backend) job = sampler.run([qc], shots=1024) result = job.result() print("✅ ์ค์ ์์ ์ปดํจํฐ ๊ฒฐ๊ณผ:", result)
๐ Qiskit (IBM)
๊ฐ์ฅ ํฐ ์ปค๋ฎค๋ํฐ, ๋ฌด๋ฃ ์ค์ HW, ํ๋ถํ ํํ ๋ฆฌ์ผ. ์ด๋ณด์ ์ถ์ฒ 1์
๐ฅ Cirq (Google)
NISQ ์ต์ ํ, Google ํ๋์จ์ด ์ ๊ทผ. ์ฐ๊ตฌ์ ์ถ์ฒ
๐ฅ Q# (Microsoft)
์ ์ฉ ์ธ์ด, ์ค๋ฅ ์ ์ ๊ฐ์ . ์ํฐํ๋ผ์ด์ฆ ์ถ์ฒ
❓IBM Quantum ๋ฌด๋ฃ ํฐ์ด์์ ์ ๊ทผ ๊ฐ๋ฅํ ํ๋ก์ธ์๋?
๊ธฐ๋ณธ ์ค์ต — ์๊ณ ๋ฆฌ์ฆ ๊ตฌํ
Deutsch ์๊ณ ๋ฆฌ์ฆ, ์์ ๋์ ์์ฑ๊ธฐ(QRNG), ๋ ธ์ด์ฆ ์ํ๊น์ง!
๐ฉ Deutsch ์๊ณ ๋ฆฌ์ฆ: ํจ์ f(x)๊ฐ ์์(constant)์ธ์ง ๊ท ํ(balanced)์ธ์ง ๋จ 1๋ฒ์ ์ฟผ๋ฆฌ๋ก ํ๋จ!
๊ณ ์ ์ปดํจํฐ๋ 2๋ฒ ํ์ → ์์์ปดํจํฐ ์ฒซ ๋ฒ์งธ ์ฐ์ ์ฆ๋ช
!
๐ ํต์ฌ: ์ค์ฒฉ + ๊ฐ์ญ(Interference)์ผ๋ก ํจ์ ์ ์ฒด๋ฅผ ํ ๋ฒ์ ์กฐํ!
from qiskit import QuantumCircuit from qiskit_aer import AerSimulator def deutsch_circuit(oracle_type='balanced'): qc = QuantumCircuit(2, 1) # ์ด๊ธฐํ: |01⟩ ์ํ qc.x(1) # Hadamard ๋ณํ (์ค์ฒฉ) qc.h(0); qc.h(1) # Oracle ์ ์ฉ if oracle_type == 'balanced': qc.cx(0, 1) # ๊ท ํ ํจ์ # constant: ์๋ฌด๊ฒ๋ ์ ํจ # ๋ง์ง๋ง Hadamard + ์ธก์ qc.h(0) qc.measure(0, 0) return qc # ์คํ sim = AerSimulator() for oracle in ['constant', 'balanced']: qc = deutsch_circuit(oracle) result = sim.run(qc, shots=100).result() counts = result.get_counts() answer = "๊ท ํ ํจ์" if '1' in counts else "์์ ํจ์" print(f"Oracle: {oracle} → ํ๋ณ: {answer}") # ๋จ 1๋ฒ์ ์ฟผ๋ฆฌ๋ก ํ๋ณ ์ฑ๊ณต!
๐ฒ QRNG: ์์ ์ค์ฒฉ์ ์ด์ฉํ ์ง์ง ๋๋ค ์ซ์ ์์ฑ!
๊ณ ์ ์ปดํจํฐ์ ์์ฌ๋์(ํจํด ์กด์ฌ)์ ๋ฌ๋ฆฌ, ๋ฌผ๋ฆฌ ๋ฒ์น์ ์ํ ์์ ํ ๋ฌด์์์ฑ!
์ํธํ, ๊ฒ์, ์๋ฎฌ๋ ์ด์
์ ํ์ฉ๋ผ์.
๐ฎ QRNG ์ธํฐ๋ํฐ๋ธ ๋ฐ๋ชจ
๐ก️ ์์ ๋
ธ์ด์ฆ: ์ค์ ํ๋์จ์ด์์ ๋ฐ์ํ๋ ์ค๋ฅ (๊ฒ์ดํธ ์ค๋ฅ, ๋์ฝํ์ด๋ฐ์ค)
๐ก️ ๋
ธ์ด์ฆ ์ํ: ์๋ฌ์จ์ ํต๊ณ์ ์ผ๋ก ๋ณด์ ํ๋ ๊ธฐ๋ฒ
• ZNE (Zero Noise Extrapolation): ๋
ธ์ด์ฆ๋ฅผ ์๋์ ์ผ๋ก ์ฆํญ ํ ์ธ์ฝ
• M3 (Matrix-free Mitigation): ์ธก์ ์ค๋ฅ ํ๋ ฌ ๋ณด์
from qiskit_aer.noise import NoiseModel from qiskit_aer.noise.errors import depolarizing_error from qiskit_aer import AerSimulator # ๋ ธ์ด์ฆ ๋ชจ๋ธ ์ ์ noise_model = NoiseModel() error_1q = depolarizing_error(0.01, 1) # 1% ๋จ์ผ ๊ฒ์ดํธ ์ค๋ฅ error_2q = depolarizing_error(0.05, 2) # 5% 2ํ๋นํธ ๊ฒ์ดํธ ์ค๋ฅ noise_model.add_all_qubit_quantum_error(error_1q, ['h', 'x']) noise_model.add_all_qubit_quantum_error(error_2q, ['cx']) # ๋ ธ์ด์ฆ ์๋ ์๋ฎฌ๋ ์ดํฐ ideal_sim = AerSimulator() noisy_sim = AerSimulator(noise_model=noise_model) # ๊ฒฐ๊ณผ ๋น๊ต print("์ด์์ ๊ฒฐ๊ณผ: {'00': 512, '11': 512}") print("๋ ธ์ด์ฆ ํฌํจ: {'00': 489, '11': 498, '01': 18, '10': 19}") print("์๋ฌ์จ: ~3.6% (์ค์ IBM ํ๋์จ์ด์ ์ ์ฌ)")
❓Deutsch ์๊ณ ๋ฆฌ์ฆ์ ํต์ฌ ์์ ์ฐ์๋ ๋ฌด์์ธ๊ฐ์?
๊ณ ๊ธ ์๊ณ ๋ฆฌ์ฆ — ๋ง์คํฐ ๋ ๋ฒจ
Shor's, Grover's, VQE — ์ธ๊ณ 1~3์ ์์ ์๊ณ ๋ฆฌ์ฆ!
๐ Shor's ์๊ณ ๋ฆฌ์ฆ (1994, Peter Shor): ํฐ ์ซ์์ ์์ธ์๋ถํด๋ฅผ ์ง์์ ์ผ๋ก ๋น ๋ฅด๊ฒ!
๊ณ ์ : O(e^n^1/3) → ์์: O(n³) → RSA ์ํธ ์ํ!
IBM์ด 2001๋
์ค์ 7ํ๋นํธ ์ปดํจํฐ๋ก 15 = 3×5 ๋ถํด ์ฑ๊ณต!
๐ ํต์ฌ ๋จ๊ณ: QFT(์์ ํธ๋ฆฌ์ ๋ณํ) → ์ฃผ๊ธฐ ์ฐพ๊ธฐ → ์ต๋๊ณต์ฝ์
from qiskit.circuit.library import QFT from qiskit import QuantumCircuit import math # Shor's ์๊ณ ๋ฆฌ์ฆ์ผ๋ก N=15 ๋ถํด (a=7 ์ ํ) N = 15; a = 7 # 1๋จ๊ณ: ๊ณ ์ ์ ์ ์ฒ๋ฆฌ if math.gcd(a, N) != 1: print(f"ํ์ด! gcd({a},{N}) = {math.gcd(a,N)}"); exit() # 2๋จ๊ณ: ์์ ์์ ์ถ์ ์ผ๋ก r (์ฃผ๊ธฐ) ์ฐพ๊ธฐ # r์ a^r ≡ 1 (mod N) ์ ๋ง์กฑํ๋ ์ต์๊ฐ # 7^1=7, 7^2=49≡4, 7^3=28≡13, 7^4=2401≡1 → r=4! r = 4 # ์ค์ ๋ก QPE ํ๋ก๋ก ์ถ์ถ # 3๋จ๊ณ: ์์ธ์ ์ถ์ถ if r % 2 == 0: x = int(a**(r//2) % N) p = math.gcd(x - 1, N) q = math.gcd(x + 1, N) print(f"✅ {N} = {p} × {q}") # → 15 = 3 × 5 print(f"๐ RSA ํค๋ฅผ ์์ ์ปดํจํฐ๋ก ๋ถํด ์ฑ๊ณต!") # 8ํ๋นํธ QPE ํ๋ก ๊ตฌ์กฐ qpe = QuantumCircuit(8 + 4, 8) # ์ค์ ๊ตฌํ ์ค์ผ์น qpe.h(range(8)) # ์์ ๋ ์ง์คํฐ ์ค์ฒฉ # ... ์ ์ด-U ์ฐ์ฐ ์ ์ฉ ... qpe.append(QFT(8, inverse=True), range(8)) # ์ญ QFT qpe.measure(range(8), range(8))
๐ Grover's ์๊ณ ๋ฆฌ์ฆ (1996): N๊ฐ ํญ๋ชฉ ์ค ์ ๋ต์ √N๋ฒ๋ง์ ์ฐพ๊ธฐ!
๊ณ ์ : O(N) → ์์: O(√N) → 100๋ง๊ฐ DB์์ 1000๋ฒ๋ง์ ๊ฒ์!
๐ ํต์ฌ: ์ค๋ผํด(oracle)์ด ์ ๋ต์ ํ์ → ์งํญ ์ฆํญ(Amplitude Amplification)์ผ๋ก ํ๋ฅ ํค์ฐ๊ธฐ
from qiskit import QuantumCircuit from qiskit_aer import AerSimulator import numpy as np def grover_oracle(n_qubits, target): # target ์ํ์๋ง -1 ์์ ์ ์ฉ oracle = QuantumCircuit(n_qubits) bits = format(target, f'0{n_qubits}b') for i, b in enumerate(bits): if b == '0': oracle.x(i) oracle.h(n_qubits-1) oracle.mcx(list(range(n_qubits-1)), n_qubits-1) oracle.h(n_qubits-1) for i, b in enumerate(bits): if b == '0': oracle.x(i) return oracle # 3ํ๋นํธ (8๊ฐ ํญ๋ชฉ), ์ ๋ต: 5 (101) n = 3; target = 5 iterations = int(np.pi / 4 * np.sqrt(2**n)) # ≈2๋ฒ qc = QuantumCircuit(n, n) qc.h(range(n)) # ๊ท ์ผ ์ค์ฒฉ for _ in range(iterations): qc.compose(grover_oracle(n, target), inplace=True) # ํ์ฐ ์ฐ์ฐ์ (Diffusion) qc.h(range(n)); qc.x(range(n)) qc.h(n-1); qc.mcx(list(range(n-1)), n-1); qc.h(n-1) qc.x(range(n)); qc.h(range(n)) qc.measure_all() result = AerSimulator().run(qc, shots=1024).result() counts = result.get_counts() winner = max(counts, key=counts.get) print(f"๐ ๊ฒ์ ์ฑ๊ณต! ์ ๋ต: {int(winner, 2)} (ํ๋ฅ : {counts[winner]/1024*100:.1f}%)")
๐งฌ VQE (Variational Quantum Eigensolver): ๋ถ์์ ๋ฐ๋ฅ ์ํ ์๋์ง ๊ณ์ฐ!
์ ์ฝ ๊ฐ๋ฐ, ์ฌ๋ฃ ๊ณผํ, ์ด๋งค ์ฐ๊ตฌ์ ํ์ฉ!
NISQ ์ปดํจํฐ(ํ์ฌ ์ธ๋)์์ ์ฌ์ฉ ๊ฐ๋ฅํ ํ์ด๋ธ๋ฆฌ๋ ์์-๊ณ ์ ์๊ณ ๋ฆฌ์ฆ
๐ฌ ์์ฉ: ์ง์ ๊ณ ์ ์ด๋งค ์ค๊ณ → ๋น๋ฃ ์์ฐ ํ๋ช
→ ํ์ ๋ฐฐ์ถ 30% ๊ฐ์ ๊ฐ๋ฅ!
from qiskit.circuit.library import TwoLocal from qiskit_algorithms import VQE from qiskit_algorithms.optimizers import COBYLA # H₂ ๋ถ์ ํด๋ฐํ ๋์ (๋จ์ํ) # ์ค์ ๋ก qiskit_nature๋ก ๋ถ์ ๊ธฐ์ from qiskit.quantum_info import SparsePauliOp H2_hamiltonian = SparsePauliOp.from_list([ ("II", -1.0523732), ("IZ", 0.3979374), ("ZI", -0.3979374), ("ZZ", -0.0112801), ("XX", 0.1809270), ]) # ํ๋ผ๋ฏธํฐํ ansatz ํ๋ก ansatz = TwoLocal( num_qubits=2, rotation_blocks='ry', entanglement_blocks='cx', reps=2 ) # VQE ์ต์ ํ ์คํ optimizer = COBYLA(maxiter=300) # vqe = VQE(estimator, ansatz, optimizer) # result = vqe.compute_minimum_eigenvalue(H2_hamiltonian) # ์์ ๊ฒฐ๊ณผ print("H₂ ๋ฐ๋ฅ ์ํ ์๋์ง:") print(f"VQE ๊ณ์ฐ๊ฐ: -1.8572 Hartree") print(f"์ ํํ ์ด๋ก ๊ฐ: -1.8573 Hartree") print(f"์ค์ฐจ: 0.006% ✅ (ํํ ์ ํ๋ ๋ฌ์ฑ!)")
❓Grover ์๊ณ ๋ฆฌ์ฆ์ ๊ฒ์ ๋ณต์ก๋๋?
๋ง์คํฐ ํ๋ก๊ทธ๋จ — ํตํฉ ๋น๋
๋ํํ CLI ํฌํผ, ํด๋ผ์ฐ๋ ์ฐ๋, ์ปค์คํ ํ๋ก ๋น๋!
#!/usr/bin/env python3 # ⚛️ ์์์ปดํจํฐ ๋ง์คํฐ ํฌํผ v1.0 # ๋ชจ๋ ์๊ณ ๋ฆฌ์ฆ์ ๋ชจ๋ํํ ๋ํํ CLI import sys, math from qiskit import QuantumCircuit from qiskit_aer import AerSimulator from qiskit.visualization import plot_histogram import matplotlib.pyplot as plt COMMANDS = { "bell": "๋ฒจ ์ํ (์ฝํ) ์์ฑ", "deutsch": "Deutsch ์๊ณ ๋ฆฌ์ฆ", "grover": "Grover ๊ฒ์ ์๊ณ ๋ฆฌ์ฆ", "shor": "Shor ์์ธ์๋ถํด", "qrng": "์์ ๋์ ์์ฑ๊ธฐ", "vqe": "VQE ์๋์ง ๊ณ์ฐ", "custom": "์ปค์คํ ํ๋ก ๋น๋", "help": "๋์๋ง", "exit": "์ข ๋ฃ" } class QuantumMasterHelper: def __init__(self): self.sim = AerSimulator() self.history = [] def run_bell(self): qc = QuantumCircuit(2, 2) qc.h(0); qc.cx(0, 1); qc.measure_all() counts = self.sim.run(qc, shots=1024).result().get_counts() self.visualize(counts, "๋ฒจ ์ํ") self.history.append("bell") def run_grover(self, target=5, n=3): # ... Grover ๊ตฌํ (์ ์ฝ๋ ์ฌ์ฌ์ฉ) ... print(f"✅ Grover ์๋ฃ! {n}ํ๋นํธ์์ {target} ๊ฒ์") self.history.append("grover") def visualize(self, counts, title): fig = plot_histogram(counts, title=title, color='#a78bfa') plt.tight_layout(); plt.show() def chat(self): print("\n⚛️ ์์์ปดํจํฐ ๋ง์คํฐ ํฌํผ ์์!") print("๋ช ๋ น์ด: " + ", ".join(COMMANDS.keys())) while True: cmd = input("\n> ๋ช ๋ น ์ ๋ ฅ: ").strip().lower() if cmd == "exit": break elif cmd == "bell": self.run_bell() elif cmd == "grover": t = int(input(" ๊ฒ์ ๋์ ์ซ์ (0-7): ")) self.run_grover(target=t) elif cmd == "help": for k,v in COMMANDS.items(): print(f" {k:10} → {v}") else: print("❓ ์ ์ ์๋ ๋ช ๋ น์ด. 'help' ์ ๋ ฅ") if __name__ == "__main__": helper = QuantumMasterHelper() helper.chat()
import plotly.graph_objects as go from plotly.subplots import make_subplots def quantum_dashboard(results_dict): fig = make_subplots( rows=2, cols=2, subplot_titles=[ "์ธก์ ๊ฒฐ๊ณผ ํ์คํ ๊ทธ๋จ", "์๋ฌ์จ ๋ถ์", "์๊ณ ๋ฆฌ์ฆ ์คํ ํ์", "์์ ํ๋ก ๊น์ด" ] ) # ์ธก์ ๊ฒฐ๊ณผ states = list(results_dict.keys()) counts = list(results_dict.values()) fig.add_trace(go.Bar( x=states, y=counts, marker_color='#a78bfa', name="์ธก์ ํ์" ), row=1, col=1) fig.update_layout( template='plotly_dark', title_text="⚛️ ์์ ํ๋ก ๋ถ์ ๋์๋ณด๋", height=600 ) fig.show() # ์คํ ์์ quantum_dashboard({'00': 512, '11': 512})
❓VQE(Variational Quantum Eigensolver)์ ์ฃผ์ ์์ฉ ๋ถ์ผ๋?
์์ ๋ง์คํฐ AI ์ด์์คํดํธ
๋ฌด์์ด๋ ๋ฌผ์ด๋ณด์ธ์!
์จ๋ผ์ธ
