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 18:08:11 UTC):

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


page from cache:  20 secunds 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):
s 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 re_part i im_part alpha beta re_part 1 j im_part alpha else alpha is 0 state is 1 phase of beta is global phase beta abs_beta state np array alpha beta dtype complex state state np linalg norm state renormalize return state test reconstruct the state psi cos pi 8 0 e i pi 3 sin pi 8 1 theta_true np pi 4 phi_true np pi 3 alpha_true np cos theta_true 2 beta_true np exp 1 j phi_true np sin theta_true 2 psi_true np array alpha_true beta_true dtype complex print f true state alpha alpha_true 4f beta beta_true 4f simulate ideal tomography measurements h 1 np sqrt 2 np array 1 1 1 1 dtype complex sdg np array 1 0 0 1 j dtype complex z measurement pz0 np abs psi_true 0 2 x measurement apply h first psi_x h psi_true px0 np abs psi_x 0 2 y measurement apply s h first psi_y h sdg psi_true py0 np abs psi_y 0 2 print f tomography probabilities pz0 pz0 4f px0 px0 4f py0 py0 4f reconstruct psi_recon tomography_reconstruct pz0 px0 py0 print f reconstructed alpha psi_recon 0 4f beta psi_recon 1 4f check states should match up to global phase overlap np abs np vdot psi_true psi_recon 2 print f fidelity overlap 6f 1 000000 this demonstrates that complex amplitudes while not directly observable leave measurable signatures when you probe the state from different angles complex numbers in density matrices for mixed states noisy qubits or subsystems of entangled states the density matrix provides a complete description rho sum_i p_i psi_i psi_i a density matrix is hermitian rho rho meaning it equals its own conjugate transpose this forces the diagonal entries to be real and the off diagonal entries to be complex conjugates of each other pure state 0 1 sqrt 2 psi_plus np array 1 np sqrt 2 1 np sqrt 2 dtype complex rho_plus psi_plus psi_plus conj t print density matrix for print rho_plus 0 5 0 5 0 5 0 5 off diagonal entries are 0 5 full coherence the off diagonal entry rho_01 0 rho 1 encodes the coherence between 0 and 1 its magnitude tells you how much quantum superposition remains and its phase tells you which superposition pure state i 0 i 1 sqrt 2 psi_plus_i np array 1 np sqrt 2 1 j np sqrt 2 dtype complex rho_plus_i psi_plus_i psi_plus_i conj t print density matrix for i print rho_plus_i 0 5 0 5j 0 5j 0 5 off diagonal entries are imaginary the phase is pi 2 completely mixed state maximally noisy rho_mixed np array 0 5 0 0 0 5 dtype complex print n completely mixed state print rho_mixed 0 5 0 0 0 5 off diagonal entries are zero no coherence decoherence is precisely the process of the off diagonal entries decaying toward zero a qubit that starts in a coherent superposition gradually loses its complex off diagonal entries and with them its ability to interfere this is why quantum computers need error correction without it the complex structure that makes quantum computation powerful degrades over time simulating dephasing off diagonal entries decay exponentially def dephased_state rho gamma apply dephasing channel with parameter gamma in 0 1 gamma 0 no dephasing gamma 1 complete dephasing result rho copy result 0 1 1 gamma result 1 0 1 gamma return result rho_initial rho_plus copy for gamma in 0 0 25 0 5 0 75 1 0 rho_t dephased_state rho_initial gamma print f gamma gamma 2f rho_01 rho_t 0 1 3f f coherence abs rho_t 0 1 3f gamma 0 00 rho_01 0 500 coherence 0 500 gamma 0 25 rho_01 0 375 coherence 0 375 gamma 0 50 rho_01 0 250 coherence 0 250 gamma 0 75 rho_01 0 125 coherence 0 125 gamma 1 00 rho_01 0 000 coherence 0 000 worked example phase estimation intuition quantum phase estimation qpe extracts the eigenvalue phase of a unitary operator let us walk through a minimal example with a single ancilla qubit suppose u has eigenvalue e i pi 2 i eigenphase 1 4 since pi 2 2 pi 1 4 the ancilla starts in and the target is in the eigenstate of u after controlled u the ancilla state is 0 e i pi 2 1 sqrt 2 0 i 1 sqrt 2 now we apply h which acts as a 1 qubit inverse qft to the ancilla ancilla state after controlled u ancilla np array 1 np sqrt 2 1 j np sqrt 2 dtype complex apply h inverse qft for 1 qubit h 1 np sqrt 2 np array 1 1 1 1 dtype complex measured h ancilla print f after h measured after h 0 5 0 5j 0 5 0 5j measurement probabilities p0 np abs measured 0 2 p1 np abs measured 1 2 print f p 0 p0 4f 0 5000 print f p 1 p1 4f 0 5000 with a single ancilla qubit both outcomes have equal probability the single ancilla can only distinguish eigenphases of 0 and 1 2 perfectly the eigenphase 1 4 falls between these so neither outcome is certain with more ancilla qubits the resolution improves using n ancilla qubits gives 2 n bins for the phase allowing you to resolve eigenphases to n bits of precision def simulate_qpe eigenphase n_ancilla simulate ideal qpe outcome probabilities for a given eigenphase eigenphase the phase phi where eigenvalue e 2 pi i phi in 0 1 n_ancilla number of ancilla qubits n 2 n_ancilla after controlled u operations and inverse qft the probability of measuring outcome m is p m sum_ k 0 n 1 e 2 pi i k phi m n n 2 probs np zeros n for m in range n amp sum np exp 2 j np pi k eigenphase m n for k in range n n probs m np abs amp 2 return probs eigenphase 0 25 eigenvalue e i pi 2 i for n in 1 2 3 4 probs simulate_qpe eigenphase n n 2 n best np argmax probs print f n n ancilla n 2d bins f best outcome best n best n 4f f p probs best 4f n 1 ancilla 2 bins best outcome 0 2 0 0000 p 0 5000 n 2 ancilla 4 bins best outcome 1 4 0 2500 p 1 0000 n 3 ancilla 8 bins best outcome 2 8 0 2500 p 1 0000 n 4 ancilla 16 bins best outcome 4 16 0 2500 p 1 0000 with 2 or more ancilla qubits the eigenphase 1 4 is resolved exactly because 1 4 is a multiple of 1 n for n 4 for eigenphases that do not align with a bin more ancilla qubits provide better approximations with the probability concentrating around the nearest bin numpy reference for complex arithmetic in quantum computing here is a compact reference of the complex number operations you will use repeatedly in quantum computing code import numpy as np z 0 5 0 5 j scalar operations np conj z complex conjugate 0 5 0 5j np abs z magnitude 0 7071 np angle z phase angle in radians 0 7854 pi 4 np exp 1 j np pi euler s formula e i pi 1 array operations 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 np conj psi element wise conjugate np abs psi 2 probabilities 0 5 0 5 np angle psi phase of each amplitude inner product conjugates the first argument np vdot psi phi psi phi psi phi matrix vector product h 1 np sqrt 2 np array 1 1 1 1 dtype complex h psi apply gate h to state psi hermitian conjugate dagger h conj t h conjugate transpose outer product for density matrices rho np outer psi np conj psi psi psi expectation value psi a psi a np array 1 0 0 1 dtype complex pauli z expect psi conj a psi note conj on the left vector print f z expect real 4f verify unitarity print np allclose h conj t h np eye 2 true common mistakes with complex numbers in quantum code 1 forgetting np abs for arrays python s built in abs works on individual complex numbers but np abs is preferred for arrays because it handles element wise operations cleanly psi np array 0 5 0 5 j 0 5 0 5 j both work for arrays but numpy is idiomatic print abs psi 0 7071 0 7071 works calls np abs internally print np abs psi 0 7071 0 7071 explicit and preferred 2 confusing conjugate methods both conjugate method and np conj function compute the complex conjugate for arrays the numpy function reads more clearly z 3 4 j print z conjugate 3 4j print np conj z 3 4j arr np array 1 2 j 3 4 j print np conj arr 1 2j 3 4j cleaner for arrays 3 misusing python exponentiation for euler s formula np exp 1j theta correctly computes e i theta using euler s formula a common mistake is writing np e 1j theta which computes 2 71828 i theta using python s power operator while mathematically equivalent the np exp form is numerically safer and universally understood theta np pi 4 correct and preferred result1 np exp 1 j theta also correct but avoid for clarity result2 np e 1 j theta print np allclose result1 result2 true but use np exp 4 forgetting the conjugate in expectation values the expectation value psi a psi requires conjugating psi on the left side omitting the conjugate produces wrong results for states with complex amplitudes a np array 1 0 0 1 dtype complex pauli z psi np array 1 np sqrt 2 1 j np sqrt 2 dtype complex wrong no conjugate wrong psi a psi print f wrong wrong 4f 0 0000 0 0000j not even real correct conjugate on the left correct psi conj a psi print f correct correct 4f 0 0000 0 0000j happens to be 0 here too more dramatic example where it matters psi2 np array np sqrt 0 8 1 j np sqrt 0 2 dtype complex wrong2 psi2 a psi2 correct2 psi2 conj a psi2 print f wrong wrong2 4f 0 6000 0 0000j wrong print f correct correct2 4f 0 6000 0 0000j same here because z is diagonal but for non diagonal operators the difference is stark x np array 0 1 1 0 dtype complex wrong3 psi2 x psi2 correct3 psi2 conj x psi2 print f x wrong wrong3 4f may have imaginary part print f x correct correct3 4f always real for hermitian operators the rule is simple expectation values of hermitian operators are always real if your result has an imaginary part check that you conjugated the left vector 5 assuming global phase is always irrelevant global phase is irrelevant for a single isolated qubit but when that qubit is part of a larger entangled system what appears to be a global phase on the subsystem becomes a relative phase in the full system two qubit state 00 11 sqrt 2 bell state bell np array 1 0 0 1 dtype complex np sqrt 2 apply a global phase of 1 to the second qubit only this means 0 0 1 1 on qubit 2 which is a z gate on qubit 2 z2 np kron np eye 2 np array 1 0 0 1 after_z z2 bell print f before z2 bell print f after z2 after_z before 0 707 0 0 0 707 after 0 707 0 0 0 707 different state relative phase changed the probabilities in the computational basis are unchanged print f probs before np abs bell 2 print f probs after np abs after_z 2 both 0 5 0 0 0 5 but entanglement correlations differ summary complex numbers are not a convenience in quantum computing they are a necessity the interference effects that give quantum algorithms their power require amplitudes that can cancel and reinforce and that requires complex arithmetic real valued amplitudes can represent some quantum states but they cannot capture the full range of quantum dynamics the key points to remember amplitudes are complex numbers probabilities are their squared magnitudes complex multiplication is rotation and scaling which is exactly what phase gates perform the full group of single qubit unitaries su 2 requires complex numbers real matrices so 2 are too restrictive phase is the angle of a complex amplitude in the complex plane global phase is unobservable for isolated qubits relative phase drives interference inner products require the complex conjugate on the left vector the bloch sphere parameterization uses two real numbers from the complex amplitude ratio phase kickback transfers eigenvalue phases to control qubits enabling quantum phase estimation the quantum fourier transform is built from roots of unity complex numbers on the unit circle density matrix off diagonal entries encode coherence decoherence destroys them quantum state tomography recovers complex amplitudes through measurements in multiple bases next steps linear algebra for quantum computing vectors matrices and the full mathematical framework bra ket notation explained the notation that physicists use for complex quantum states how quantum algorithms work showing how interference is put to work in algorithm design try it yourself python quantum playground open full screen run python with numpy preloaded right here edit the code and execute it instantly it runs entirely in your browser no signup or install written by dr donovan who writes on quantum computing research hardware and industry at quantum zeitgeist dr donovan ran his first quantum circuit on ibm s 5 qubit quantum experience in 2018 and has not put the subject down since he built quantumcomputingcourses com because the material out there forced a choice nobody should have to make pop science hand waving at one end phd level physics with no on ramp at the other and tutorial code that had usually stopped working by the time you found it he also writes on quantum computing at quantum zeitgeist quantumzeitgeist com was this tutorial helpful yes no share ready to go deeper browse structured courses from coursera edx udemy brilliant and more browse courses related tutorials contin...
Images from subpage: "quantumcomputingcourses.com/reference/pennylane" Verify
Images from subpage: "quantumcomputingcourses.com/reference/braket" Verify
Images from subpage: "quantumcomputingcourses.com/reference/pyquil" Verify
Images from subpage: "quantumcomputingcourses.com/reference/tket" Verify
Images from subpage: "quantumcomputingcourses.com/reference/ocean" 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???/"