Michael Neuberger’s Post

Yesterday I had a bit free time and I built a quantum multiplier simulator that follows established arithmetic designs (Cuccaro adder, shift-and-add multiplication) and provides detailed circuit metrics. Key features: - Basis-state tracking for fast measurement - Memory-aware allocation with warnings - Clear separation of logical vs. physical qubits via MCX decomposition - QASM export for use with Qiskit / Cirq The simulator reproduces correct results across test cases and exposes gate counts, depth, and qubit usage. While limited by state-vector scaling, it’s a practical tool for analyzing quantum arithmetic circuits. Code is available here: 👉 https://lnkd.in/dX834Dfh Have fun with exploring it 😉

  • No alternative text description for this image

Output looks like that:    9 × 9  => quantum=81   classical=81   logical_qubits=17 physical_qubits=18 time=99.097ms ✓   logical: gates={'TOTAL': 104, 'X': 4, 'CX': 0, 'CCX': 68, 'SWAP': 0, 'MCX_3+': 32} depth=98 topo=None   decomposed: gates={'TOTAL': 136, 'X': 4, 'CX': 0, 'CCX': 132, 'SWAP': 0, 'MCX_3+': 0} depth=130 peak_virt_anc=1 --------------------------------------------------------------------------------------  15 × 16  => quantum=240  classical=240  logical_qubits=19 physical_qubits=20 time=580.984ms ✓   logical: gates={'TOTAL': 130, 'X': 5, 'CX': 0, 'CCX': 85, 'SWAP': 0, 'MCX_3+': 40} depth=121 topo=None   decomposed: gates={'TOTAL': 170, 'X': 5, 'CX': 0, 'CCX': 165, 'SWAP': 0, 'MCX_3+': 0} depth=161 peak_virt_anc=1 --------------------------------------------------------------------------------------  -7 × 8  => quantum=-56  classical=-56  logical_qubits=15 physical_qubits=16 time=6.256ms ✓   logical: gates={'TOTAL': 80, 'X': 4, 'CX': 0, 'CCX': 52, 'SWAP': 0, 'MCX_3+': 24} depth=73 topo=None   decomposed: gates={'TOTAL': 104, 'X': 4, 'CX': 0, 'CCX': 100, 'SWAP': 0, 'MCX_3+': 0} depth=97 peak_virt_anc=1

Like
Reply

To view or add a comment, sign in

Explore content categories