If you are not sure if the website you would like to visit is secure, you can verify it here. Enter the website address of the page and see parts of its content and the thumbnail images on this site. None (if any) dangerous scripts on the referenced page will be executed. Additionally, if the selected site contains subpages, you can verify it (review) in batches containing 5 pages.
favicon.ico: quantumcomputingcourses.com/tutorials/complex-numbers-quantum-computing - Complex Numbers in Quantum Com.

site address: quantumcomputingcourses.com/tutorials/complex-numbers-quantum-computing

site title: Complex Numbers in Quantum Computing

Our opinion (on Saturday 03 October 2026 22:40:14 UTC):

GREEN status (no comments) - no comments
After content analysis of this website we propose the following hashtags:


page from cache: 4 hours ago
Meta tags:
description=Why quantum computing uses complex numbers, how quantum amplitudes work, and the role of phase in quantum interference.;
author=;

Headings (most frequently used words):

complex, quantum, in, the, numbers, and, phase, is, why, computing, amplitudes, it, for, conjugate, what, euler, formula, inner, products, from, matters, interference, reference, python, requires, forgetting, number, polar, form, real, are, not, enough, needs, bloch, sphere, probability, how, affects, computation, gates, kickback, exponentials, algorithms, measuring, state, tomography, density, matrices, worked, example, estimation, intuition, numpy, arithmetic, common, mistakes, with, code, summary, next, steps, try, yourself, playground, related, tutorials, get, one, email, week, multiplication, rotation, scaling, gate, entries, full, group, of, single, qubit, unitaries, three, parameters, born, rule, double, slit, analogy, np, abs, arrays, confusing, methods, misusing, exponentiation, expectation, values, assuming, global, always, irrelevant, ready, to, go, deeper, learn, careers, about,

Text of the page (most frequently used words):
the (223), complex (137), quantum (90), print (89), and (79), phase (75), psi (70), sqrt (69), state (51), for (50), array (50), dtype (47), theta (47), alpha (42), phi (41), abs (40), qubit (39), beta (38), #numbers (37), #amplitudes (34), with (32), real (30), are (29), conjugate (26), this (25), gate (22), computing (21), that (21), angle (21), 707 (20), conj (19), ancilla (19), you (18), exp (18), magnitude (18), from (17), probability (17), entries (17), probabilities (17), interference (16), amplitude (16), after (15), gamma (15), what (14), how (14), why (14), states (14), control (14), global (14), single (14), measurement (14), degrees (14), algorithm (13), all (13), inner (13), has (13), outcome (13), sin (13), bloch (12), sphere (12), courses (12), diagonal (12), matrix (12), but (12), apply (12), cos (12), gates (11), number (11), can (11), wrong (11), psi2 (11), 0000 (11), product (11), guide (10), one (10), read (10), not (10), full (10), coherence (10), qubits (10), imaginary (10), correct (10), amp (10), tutorials (9), python (9), example (9), density (9), algorithms (9), off (9), eigenvalue (9), relative (9), eigenphase (9), best (9), its (9), min (8), numpy (8), matrices (8), tomography (8), euler (8), formula (8), because (8), two (8), vector (8), both (8), probs (8), when (8), part (8), 0000j (8), verify (8), target (8), eigenstate (8), pz0 (8), get (7), bell (7), code (7), estimation (7), measuring (7), work (7), more (7), have (7), roots (7), rotation (7), which (7), different (7), where (7), true (7), function (7), 7071 (7), rho (7), vdot (7), each (7), rho_01 (7), psi_plus (7), px0 (7), py0 (7), after_s (7), pole (7), reference (6), paths (6), written (6), products (6), polar (6), form (6), first (6), left (6), requires (6), magnitudes (6), range (6), always (6), same (6), allclose (6), operations (6), bins (6), return (6), sum (6), def (6), unitary (6), zero (6), amp_1 (6), amp_0 (6), bloch_to_statevector (6), 2026 (5), com (5), about (5), hardware (5), framework (5), case (5), qiskit (5), arithmetic (5), kickback (5), matters (5), here (5), unity (5), unit (5), phases (5), squared (5), they (5), basis (5), unchanged (5), eye (5), only (5), becomes (5), result (5), difference (5), arrays (5), controlled (5), qft (5), superposition (5), without (5), psi_plus_i (5), pure (5), psi_i (5), angles (5), psi_true (5), measure (5), normalization (5), omega (5), final (5), initial (5), component (5), constant (5), add (5), balanced (5), lambda (5), use (4), learning (4), free (4), zeitgeist (4), donovan (4), next (4), common (4), exponentials (4), affects (4), computation (4), circuit (4), built (4), out (4), measurements (4), uses (4), plane (4), multiplication (4), cancel (4), cannot (4), before (4), computational (4), kron (4), entangled (4), expectation (4), hermitian (4), using (4), dagger (4), will (4), 5000 (4), gives (4), between (4), measured (4), 500 (4), dephasing (4), need (4), psi_recon (4), reconstruct (4), norm (4), then (4), three (4), every (4), dft (4), negative (4), hello (4), world (4), your (3), policy (3), hadamard (3), amazon (3), team (3), careers (3), glossary (3), studies (3), writes (3), cirq (3), pennylane (3), intermediate (3), any (3), point (3), test (3), entanglement (3), time (3), beginner (3), steps (3), summary (3), mistakes (3), worked (3), intuition (3), needs (3), enough (3), these (3), browse (3), tutorial (3), since (3), physics (3), other (3), mathematical (3), through (3), multiple (3), fourier (3), transform (3), ratio (3), isolated (3), group (3), scaling (3), exactly (3), their (3), points (3), after_z (3), system (3), operators (3), check (3), non (3), even (3), pauli (3), value (3), preferred (3), while (3), element (3), unitarity (3), conjugates (3), eigenphases (3), 2500 (3), inverse (3), n_ancilla (3), given (3), now (3), starts (3), 000 (3), rho_t (3), rho_plus (3), complete (3), mixed (3), directly (3), observable (3), beta_true (3), alpha_true (3), theta_true (3), im_part (3), re_part (3), abs_alpha (3), step (3), information (3), control_after (3), factor (3), most (3), after_t (3), 707j (3), converts (3), into (3), destructive (3), constructive (3), path (3), produce (3), psi1 (3), applied (3), equator (3), south (3), north (3), parameters (3), prob_1 (3), prob_0 (3), lam (3), prerequisites (3), braket (3), cookies (2), experience (2), affiliate (2), see (2), terms (2), quantumcomputingcourses (2), books (2), podcasts (2), events (2), faq (2), editorial (2), jobs (2), interview (2), certifications (2), salary (2), programming (2), timeline (2), types (2), news (2), frameworks (2), learn (2), who (2), research (2), industry (2), references (2), tools (2), quantumcomputing (2), email (2), changed (2), week (2), reaching (2), bernstein (2), vazirani (2), implementing (2), hidden (2), string (2), finder (2), inequalities (2), chsh (2), know (2), related (2), language (2), level (2), computers (2), guides (2), coursera (2), edx (2), udemy (2), brilliant (2), deeper (2), ibm (2), put (2), there (2), should (2), also (2), entirely (2), try (2), yourself (2), notation (2), bra (2), bases (2), encode (2), them (2), decoherence (2), circle (2), require (2), unobservable (2), unitaries (2), too (2), key (2), effects (2), give (2), power (2), reinforce (2), some (2), irrelevant (2), rule (2), values (2), correct3 (2), wrong3 (2), 6000 (2), correct2 (2), wrong2 (2), happens (2), results (2), forgetting (2), result1 (2), result2 (2), computes (2), operator (2), arr (2), works (2), wise (2), expect (2), outer (2), transpose (2), argument (2), import (2), bin (2), simulate_qpe (2), zeros (2), simulate (2), ideal (2), qpe (2), precision (2), distinguish (2), 125 (2), 250 (2), 375 (2), dephased_state (2), rho_initial (2), copy (2), parameter (2), interfere (2), structure (2), makes (2), rho_mixed (2), completely (2), noisy (2), rho_plus_i (2), entry (2), tells (2), meaning (2), equals (2), sum_i (2), provides (2), measurable (2), 000000 (2), overlap (2), reconstructed (2), tomography_reconstruct (2), psi_y (2), sdg (2), psi_x (2), phi_true (2), linalg (2), abs_beta (2), positive (2), p_y (2), maps (2), p_x (2), shor (2), 4x4 (2), change (2), shifted (2), minus_state (2), back (2), proj_1 (2), proj_0 (2), concrete (2), important (2), changing (2), 785 (2), rad (2), adds (2), contribute (2), sign (2), constructively (2), opposite (2), deutsch (2), consider (2), bit (2), whether (2), contributes (2), squaring (2), double (2), slit (2), reach (2), detector (2), leading (2), answers (2), grover (2), cancelled (2), would (2), combined (2), making (2), likely (2), alone (2), collapses (2), psi_minus (2), ket_1 (2), ket_0 (2), subsequent (2), correct_norm (2), wrong_norm (2), just (2), name (2), azimuthal (2), arbitrary (2), rotations (2), orthogonal (2), dimensional (2), identity_check (2), u_gate (2), general (2), necessary (2), theta1 (2), theta2 (2), role (2), wave (2), accept, decline, improve, track, performance, our, cookie, privacy, disclosure, llc, associate, earn, qualifying, purchases, contact, site, talent, pool, post, job, training, questions, cheatsheets, history, docs, compare, maintained, curated, anyone, 241, 220, 112, subscribe, address, new, worth, taking, spam, unsubscribe, anytime, qsilver, workshop, qworld, paid, jun, updated, glance, page, chemistry, basics, programs, previous, continue, structured, ready, share, yes, was, helpful, quantumzeitgeist, ran, his, 2018, subject, down, material, forced, choice, nobody, make, pop, science, hand, waving, end, phd, ramp, had, usually, stopped, working, found, run, preloaded, right, edit, execute, instantly, runs, browser, signup, install, open, screen, playground, showing, design, physicists, ket, explained, vectors, linear, algebra, recovers, destroys, transfers, enabling, parameterization, drives, restrictive, perform, remember, convenience, necessity, valued, represent, capture, dynamics, correlations, differ, means, second, larger, appears, subsystem, assuming, simple, conjugated, may, stark, dramatic, conjugating, side, omitting, produces, avoid, clarity, correctly, mathematically, equivalent, numerically, safer, universally, understood, mistake, writing, 71828, misusing, exponentiation, cleaner, method, compute, reads, clearly, confusing, methods, explicit, calls, internally, idiomatic, individual, handles, cleanly, note, radians, 7854, scalar, compact, repeatedly, resolved, align, provide, better, approximations, concentrating, around, nearest, argmax, sum_, resolution, improves, allowing, resolve, bits, outcomes, equal, perfectly, falls, neither, certain, acts, suppose, extracts, let, walk, minimal, channel, simulating, decay, exponentially, precisely, process, decaying, toward, coherent, gradually, loses, ability, error, correction, powerful, degrades, over, maximally, encodes, much, remains, own, forces, p_i, subsystems, description, demonstrates, leave, signatures, probe, fidelity, match, renormalize, else, choose, fixing, returns, sets, suffice, procedure, called, yields, lost, preserves, frequency, foundation, factoring, round, build, deg, enumerate, equally, spaced, distinct, nth, started, ended, mechanism, behind, many, extract, kicked, still, kicks, onto, setup, phenomena, occurs, applying, instead, acquires, standard, illustrate, signs, deterministic, clean, determines, query, principle, circuits, output, experiment, particle, take, total, analogy, designed, based, achieve, speedups, cancellation, renormalization, together, destructively, less, genuinely, however, joint, subtlety, essence, components, physically, meaningful, identical, overall, entire, effect, ignored, kinds, those, determine, respond, via, normalize, born, version, fixes, expected, dot, itself, could, 5000j, define, denotes, optional, definite, phi_i, within, numerical, convert, coordinates, corresponds, unique, tan, undefined, vanishes, mapping, been, factored, leaving, though, like, parts, appear, essential, evolve, satisfying, starting, restricted, 2x2, family, access, space, mechanics, allows, reason, belongs, replace, keeping, performs, specific, expressed, rotate, might, wonder, truly, purely, remain, shift, become, visible, 7071j, rotated, start, multiplies, rotates, demonstrate, multiply, multiplying, transparent, useful, identities, connects, 606, absolute, measures, distance, flips, imag, defined, property, everywhere, involve, explains, plays, along, way, concept, claim, sections, background, needed, basic, variables, functions, loops, feb, series, concepts, home, search, troubleshooting, prep, universities, career, cheat, sheets, migration, comparison, pinball, explore, ocean, tket, pyquil, rigetti, quera, azure, quantinuum, ionq, google, providers, course, platforms, skip, main, content,


Text of the page (random words):
o 2 it can rotate a qubit s amplitudes and the entries are all real so why do we need complex numbers at all the y gate requires complex entries the pauli y gate performs a specific rotation that cannot be expressed with real numbers alone y np array 0 1 j 1 j 0 dtype complex verify it is unitary y y i print y conj t y 1 0 j 0 0 j 0 0 j 1 0 j if you try to replace the i entries with real numbers while keeping the gate unitary you get a different gate with different physics the full group of single qubit unitaries requires three parameters the deeper reason is mathematical the most general single qubit unitary gate belongs to the group su 2 and requires three real parameters theta phi lambda u theta phi lambda cos theta 2 e i lambda sin theta 2 e i phi sin theta 2 e i phi lambda cos theta 2 def u_gate theta phi lam general single qubit unitary in su 2 return np array np cos theta 2 np exp 1 j lam np sin theta 2 np exp 1 j phi np sin theta 2 np exp 1 j phi lam np cos theta 2 dtype complex example theta pi 2 phi pi 4 lambda pi 3 u u_gate np pi 2 np pi 4 np pi 3 verify unitarity identity_check u conj t u print np allclose identity_check np eye 2 true real orthogonal 2x2 matrices so 2 have only one parameter the rotation angle that gives you a one dimensional family of gates su 2 is three dimensional complex numbers give you access to the full space of single qubit operations that quantum mechanics allows without complex numbers you cannot reach arbitrary points on the bloch sphere from an arbitrary starting state you would be restricted to rotations in a single plane why quantum computing needs complex numbers a quantum state is a vector of complex amplitudes for a qubit psi alpha 0 beta 1 where alpha and beta are complex numbers satisfying alpha 2 beta 2 1 the probabilities of measuring each outcome are the squared magnitudes of the amplitudes the imaginary parts do not appear in the measurement probabilities directly but they are essential for how quantum states evolve and interfere a state with complex amplitudes alpha 1 np sqrt 2 beta 1 j np sqrt 2 imaginary amplitude prob_0 abs alpha 2 prob_1 abs beta 2 print f p 0 prob_0 3f 0 500 print f p 1 prob_1 3f 0 500 print f sum prob_0 prob_1 3f 1 000 even though the probabilities are 50 50 just like the state this state is different its phase structure will produce different results when gates are applied the bloch sphere and complex amplitudes every single qubit pure state can be written as psi cos theta 2 0 e i phi sin theta 2 1 where theta and phi are the polar and azimuthal angles on the bloch sphere the global phase has been factored out leaving two real parameters from the complex amplitude ratio the key mapping is theta 0 north pole the state is 0 the azimuthal angle phi is undefined because sin 0 0 so the e i phi factor vanishes entirely theta pi south pole the state is 1 theta pi 2 phi 0 the state is 0 1 sqrt 2 theta pi 2 phi pi the state is 0 1 sqrt 2 theta pi 2 phi pi 2 the state is i 0 i 1 sqrt 2 every point on the bloch sphere corresponds to a unique complex amplitude ratio beta alpha e i phi tan theta 2 def bloch_to_statevector theta phi convert bloch sphere coordinates theta phi to a state vector alpha np cos theta 2 beta np exp 1 j phi np sin theta 2 return np array alpha beta dtype complex north pole 0 print north pole bloch_to_statevector 0 0 1 0 j 0 0 j south pole 1 print south pole bloch_to_statevector np pi 0 0 1 0 j within numerical precision equator phi 0 psi_plus bloch_to_statevector np pi 2 0 print psi_plus 0 707 0 j 0 707 0 j equator phi pi 2 i psi_plus_i bloch_to_statevector np pi 2 np pi 2 print i psi_plus_i 0 707 0 j 0 0 707j verify normalization for all states for name th ph in pole 0 3 1 7 equator np pi 2 2 1 psi bloch_to_statevector th ph print f name alpha 2 beta 2 np abs psi 0 2 np abs psi 1 2 6f always 1 000000 inner products and probability from complex amplitudes the inner product of two quantum states psi and phi is psi phi sum_i psi_i phi_i where psi_i denotes the complex conjugate of psi_i the conjugate on the left vector the bra is not optional it is what makes the inner product positive definite meaning psi psi is always a non negative real number define two states psi np array 1 np sqrt 2 1 j np sqrt 2 dtype complex phi np array 1 np sqrt 2 1 np sqrt 2 dtype complex inner product psi phi psi phi inner np vdot psi phi np vdot conjugates the first argument print f psi phi inner 4f 0 5000 0 5000j normalization check psi psi 1 norm np vdot psi psi print f psi psi norm 4f 1 0000 0 0000j why the conjugate matters without the conjugate the inner product of a state with itself could be zero or even negative for complex amplitudes consider psi 1 i sqrt 2 psi np array 1 1 j dtype complex np sqrt 2 wrong no conjugate just a dot product wrong_norm psi psi print f without conjugate wrong_norm 4f 0 0000 0 0000j zero correct with conjugate correct_norm psi conj psi print f with conjugate correct_norm 4f 1 0000 0 0000j one as expected the wrong version gives zero because 1 1 i i 1 1 0 the conjugate fixes this 1 1 i i 1 1 2 and after normalization we get 1 the born rule from inner products the probability of measuring a state psi in the computational basis state 0 is p 0 0 psi 2 alpha 2 alpha 2 where alpha is the 0 component of psi the conjugate on alpha and the subsequent squaring of the magnitude produce a real non negative probability psi np array 0 6 0 2 j 0 3 0 7 j dtype complex normalize psi psi np linalg norm psi basis states ket_0 np array 1 0 dtype complex ket_1 np array 0 1 dtype complex probabilities via inner products p0 np abs np vdot ket_0 psi 2 p1 np abs np vdot ket_1 psi 2 print f p 0 p0 4f print f p 1 p1 4f print f sum p0 p1 4f 1 0000 phase what it is and why it matters the phase of a complex amplitude is its angle in the complex plane two states can have the same measurement probabilities but different phases and those phases determine how the states respond to gates there are two kinds of phase to distinguish global phase is an overall factor e i theta applied to the entire state it has no observable effect and can always be ignored psi1 np array 1 np sqrt 2 1 np sqrt 2 dtype complex psi2 np exp 1 j np pi 4 psi1 global phase applied probabilities are identical print abs psi1 2 0 5 0 5 print abs psi2 2 0 5 0 5 relative phase is a phase difference between components of a superposition relative phase is physically meaningful because it affects interference state both amplitudes in phase psi_plus np array 1 np sqrt 2 1 np sqrt 2 dtype complex state amplitudes out of phase by pi psi_minus np array 1 np sqrt 2 1 np sqrt 2 dtype complex apply hadamard to both h 1 np sqrt 2 np array 1 1 1 1 dtype complex print h psi_plus 1 0 j 0 0 j collapses to 0 print h psi_minus 0 0 j 1 0 j collapses to 1 the hadamard gate converts relative phase into a difference in measurement probabilities this is the essence of quantum interference important subtlety global phase is genuinely unobservable for isolated qubits however relative phase between qubits in an entangled state is observable when qubit a is entangled with qubit b a global phase on qubit a alone becomes a relative phase of the joint system and can produce measurable effects interference how phase affects computation quantum interference happens when probability amplitudes add together amplitudes with the same phase add constructively making the outcome more likely amplitudes with opposite phases cancel destructively making the outcome less likely constructive interference a 1 np sqrt 2 b 1 np sqrt 2 combined a b amplitudes add up print abs combined 2 2 0 but this would need renormalization destructive interference c 1 np sqrt 2 d 1 np sqrt 2 cancelled c d print abs cancelled 2 0 0 complete cancellation in a real quantum algorithm the circuit is designed so that amplitudes leading to wrong answers cancel and amplitudes leading to correct answers reinforce this is how grover s algorithm and quantum fourier transform based algorithms achieve their speedups interference in the double slit analogy in a double slit experiment a particle can take two paths to reach a detector each path contributes a complex amplitude the total amplitude at the detector is the sum of both path amplitudes and the probability is the squared magnitude of that sum this is the same principle at work in quantum circuits each computational path through a circuit contributes a complex amplitude to a given output the amplitudes from all paths sum before squaring to get a probability the deutsch algorithm provides a clean example consider a function f that maps one bit to one bit the algorithm determines whether f is constant f 0 f 1 or balanced f 0 f 1 with a single query h 1 np sqrt 2 np array 1 1 1 1 dtype complex after the deutsch circuit the amplitude of measuring 0 on the first qubit is 1 f 0 1 f 1 2 case 1 constant function f 0 0 f 1 0 f0 f1 0 0 amp_0 1 f0 1 f1 2 amp_1 1 f0 1 f1 2 print f constant amp 0 amp_0 2f amp 1 amp_1 2f print f p 0 abs amp_0 2 2f p 1 abs amp_1 2 2f constant amp 0 1 00 amp 1 0 00 constructive interference on 0 destructive on 1 case 2 balanced function f 0 0 f 1 1 f0 f1 0 1 amp_0 1 f0 1 f1 2 amp_1 1 f0 1 f1 2 print f balanced amp 0 amp_0 2f amp 1 amp_1 2f print f p 0 abs amp_0 2 2f p 1 abs amp_1 2 2f balanced amp 0 0 00 amp 1 1 00 destructive interference on 0 constructive on 1 for the constant function both paths contribute the same sign so they add constructively for the balanced function the paths contribute opposite signs and cancel interference converts a phase difference into a deterministic measurement outcome complex numbers in quantum gates all standard quantum gates have complex entries the y gate and the s gate illustrate this y np array 0 1 j 1 j 0 dtype complex s np array 1 0 0 1 j dtype complex s gate adds a phase of i to the 1 component psi np array 1 np sqrt 2 1 np sqrt 2 dtype complex after_s s psi print after_s 0 707 0 j 0 0 707j the 1 component now has a phase of i e i pi 2 the t gate pi 8 gate adds a phase of e i pi 4 to the 1 component t np array 1 0 0 np exp 1 j np pi 4 dtype complex after_t t psi print after_t 0 707 0 j 0 5 0 5j print np angle after_t 1 0 785 rad pi 4 phase kickback phase kickback is one of the most important phenomena in quantum algorithms it occurs when applying a controlled u gate and the target qubit is an eigenstate of u instead of the target qubit changing the control qubit acquires a phase here is the setup u is a unitary with eigenstate u and eigenvalue e i phi that is u u e i phi u when we apply controlled u with the control qubit in superposition and the target in u cu 0 1 sqrt 2 u 0 u e i phi 1 u sqrt 2 0 e i phi 1 sqrt 2 u the phase kicks back onto the control qubit the target qubit is unchanged concrete example cz gate target in 1 eigenstate of z with eigenvalue 1 z gate z np array 1 0 0 1 dtype complex 1 is an eigenstate of z with eigenvalue 1 e i pi eigenstate np array 0 1 dtype complex print f z 1 z eigenstate 0 1 1 1 e i pi 1 control qubit starts in control np array 1 np sqrt 2 1 np sqrt 2 dtype complex cz gate as a 4x4 matrix cz 0 0 x i 1 1 x z i np eye 2 dtype complex proj_0 np array 1 0 0 0 dtype complex 0 0 proj_1 np array 0 0 0 1 dtype complex 1 1 cz np kron proj_0 i np kron proj_1 z full initial state control x target initial np kron control eigenstate print f initial state initial 0 0 707 0 0 707 apply cz final cz initial print f final state final 0 0 707 0 0 707 factor out the target it s still 1 the control qubit is now 0 1 sqrt 2 phase e i pi 1 has kicked back to the control qubit control_after np array final 1 final 3 extract control amplitudes print f control after control_after 0 707 0 707 verify this is up to normalization minus_state np array 1 np sqrt 2 1 np sqrt 2 dtype complex print f is np allclose control_after minus_state true the control qubit started in and ended in the z eigenvalue of 1 e i pi shifted the relative phase of the control qubit by pi this is the mechanism behind quantum phase estimation and many other quantum algorithms complex exponentials in quantum algorithms the quantum fourier transform qft is built from roots of unity the nth roots of unity are the n complex numbers omega k e 2 pi i k n for k 0 1 n 1 these n points are equally spaced on the unit circle each has magnitude 1 pure phase no amplitude change and a distinct angle roots of unity for n 8 n 8 roots np exp 2 j np pi k n for k in range n print n 8 roots of unity for k w in enumerate roots print f omega k w 4f f magnitude abs w 4f angle np degrees np angle w 7 1f deg the dft matrix has entries f j k omega jk sqrt n for n 4 n 4 omega np exp 2 j np pi n i build the 4x4 dft matrix f np zeros n n dtype complex for j in range n for k in range n f j k omega j k np sqrt n print dft matrix n 4 print np round f 3 0 5 0 j 0 5 0 j 0 5 0 j 0 5 0 j 0 5 0 j 0 0 5j 0 5 0 j 0 0 5j 0 5 0 j 0 5 0 j 0 5 0 j 0 5 0 j 0 5 0 j 0 0 5j 0 5 0 j 0 0 5j verify unitarity f f i print n f f i np allclose f conj t f np eye n true verify all entries have magnitude 1 sqrt n print all entries magnitude 1 sqrt n np allclose np abs f 1 np sqrt n true because every entry of the dft matrix has the same magnitude 1 sqrt n the qft preserves normalization the complex phases are what encode the frequency information this is the mathematical foundation of shor s factoring algorithm and quantum phase estimation measuring complex amplitudes quantum state tomography you cannot directly measure the complex amplitudes of a quantum state a measurement in the computational basis yields only probabilities which are the squared magnitudes alpha 2 and beta 2 all phase information is lost to reconstruct the full complex state you need to measure in multiple bases this procedure is called quantum state tomography for a single qubit psi alpha 0 beta 1 three sets of measurements suffice step 1 measure in the z basis to get alpha 2 and beta 2 step 2 apply h then measure in z to get information about re alpha beta after h the state becomes alpha beta alpha beta sqrt 2 the probability of outcome 0 is p_x 0 alpha beta 2 2 alpha 2 beta 2 2 re alpha beta 2 so re alpha beta p_x 0 1 2 step 3 apply s dagger then h then measure in z to get im alpha beta s dagger maps 1 to i 1 so after s dagger beta becomes i beta then h gives the probability p_y 0 alpha i beta 2 2 alpha 2 beta 2 2 re alpha i beta 2 1 2 im alpha beta 2 so im alpha beta p_y 0 1 2 def tomography_reconstruct pz0 px0 py0 reconstruct a single qubit state from tomography probabilities pz0 probability of 0 in z measurement px0 probability of 0 after h x measurement py0 probability of 0 after s h y measurement returns the reconstructed state vector up to global phase from z measurement abs_alpha np sqrt pz0 abs_beta np sqrt 1 pz0 choose alpha real and positive fixing global phase alpha abs_alpha from x and y measurements re_part px0 0 5 re alpha beta im_part py0 0 5 im alpha beta if abs_alpha 1e 10 alpha beta alpha beta since alpha is real so beta ...
Images from subpage: "quantumcomputingcourses.com/migration" Verify
Images from subpage: "quantumcomputingcourses.com/timeline" Verify
Images from subpage: "quantumcomputingcourses.com/cheatsheets" Verify
Images from subpage: "quantumcomputingcourses.com/events" Verify
Images from subpage: "quantumcomputingcourses.com/jobs" Verify

Verified site has: 100 subpage(s). Do you want to verify them? Verify pages:

1-5 6-10 11-15 16-20 21-25 26-30 31-35 36-40 41-45 46-50
51-55 56-60 61-65 66-70 71-75 76-80 81-85 86-90 91-95 96-100


The site also has 1 references to external domain(s).

 quantumzeitgeist.com  Verify


Top 50 hastags from of all verified websites.

Supplementary Information (add-on for SEO geeks)*- See more on header.verify-www.com

Header

HTTP/2 200
cache-control public, max-age=0, must-revalidate
content-encoding gzip
content-type text/html; charset=utf-8
etag f540f8893ff9d69312d5ef9baa862f9bce4921f6a1879cc7588e4374f4b6d361
last-modified Sat, 12 Sep 2026 20:05:51 GMT
strict-transport-security max-age=31556926
accept-ranges bytes
date Sat, 03 Oct 2026 18:07:51 GMT
x-served-by cache-lcy-egml8630044-LCY
x-cache HIT
x-cache-hits 0
x-timer S1791050872.506356,VS0,VE1
vary x-fh-requested-host, accept-encoding
alt-svc h3= :443 ;ma=86400,h3-29= :443 ;ma=86400,h3-27= :443 ;ma=86400
content-length 28979

Meta Tags

title="Complex Numbers in Quantum Computing"
charset="UTF-8"
name="viewport" content="width=device-width, initial-scale=1"
name="description" content="Why quantum computing uses complex numbers, how quantum amplitudes work, and the role of phase in quantum interference."
property="og:type" content="article"
property="og:url" content="htt????/quantumcomputingcourses.com/tutorials/complex-numbers-quantum-computing"
property="og:title" content="Complex Numbers in Quantum Computing | QuantumComputingCourses.com"
property="og:description" content="Why quantum computing uses complex numbers, how quantum amplitudes work, and the role of phase in quantum interference."
property="og:image" content="htt????/quantumcomputingcourses.com/images/library/grover.webp"
property="og:image:width" content="1200"
property="og:image:height" content="630"
property="og:locale" content="en_US"
property="og:site_name" content="QuantumComputingCourses.com"
property="article:published_time" content="2026-02-27T00:00:00.000Z"
property="article:author" content="QuantumComputingCourses.com"
name="twitter:card" content="summary_large_image"
name="twitter:title" content="Complex Numbers in Quantum Computing | QuantumComputingCourses.com"
name="twitter:description" content="Why quantum computing uses complex numbers, how quantum amplitudes work, and the role of phase in quantum interference."
name="twitter:image" content="htt????/quantumcomputingcourses.com/images/library/grover.webp"
name="theme-color" content="#fffaf3"
name="color-scheme" content="light dark"
name="darkreader-lock"
name="author" content="QuantumComputingCourses.com"
name="google-site-verification" content="AUHneuZfjppbdqvvRkpwjhiFC2kqmW6SfDDJWqAY_rs"

Load Info

page size208413
load time (s)0.061886
redirect count0
speed download475065
server IP 199.36.158.100
* all occurrences of the string "http://" have been changed to "htt???/"