Skip to content

Core principles of Quantum Physics and Quantum Computing

License

Notifications You must be signed in to change notification settings

rafaelfgx/QuantumComputing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quantum Computing

It seems like magic, but it is simply nature and the universe in their most intrinsic and fundamental state!

The universe is not classical! Our intuition is limited, shaped by large, slow, and predictable scales!

When we go down to the fundamental level, reality is not deterministic! It is wave-like, probabilistic, and deeply relational!

For centuries, we tried to force the universe to think like classical machines! But now we do the opposite: we build machines that think like the universe itself!

Qubits are not tricks. Superposition is not a mystery. Entanglement is not a miracle. They are facts of nature!

Superpowers

  • Explore many possibilities simultaneously! It's like calculating multiple parallel universes and then collapsing into the correct result!

  • Simulate nature at its deepest and most intrinsic level, because everything that exists in the universe obeys quantum laws!

  • Simulate complex molecules, create new materials, and dramatically accelerate drug discovery!

  • For specific tasks, a quantum computer can solve problems in a fraction of the time (seconds, hours, days) that classical supercomputers would take millions or billions of years!

  • It can break current cryptography with ease, while at the same time making possible cryptography grounded in the very laws of physics - impossible to spy on or break without being detected!

Quantum Physics

  • Energy Quantization

    • Definition: The energy of physical systems, such as atoms, does not vary continuously but in discrete packets called quanta.

    • Example: In atoms and molecules, electrons can only occupy specific energy levels. Transitions between these levels occur through the absorption or emission of photons with well-defined energies.

    • Analogy: It is like climbing a staircase where you can only stand on specific steps and never in between.

  • Wave-Particle Duality

    • Definition: Subatomic particles, such as electrons and photons, can behave as both particles and waves, depending on the type of experiment.

    • Example: In the double-slit experiment, individual electrons form interference patterns typical of waves. In detectors, such as in the photoelectric effect, they are recorded as localized impacts, characteristic of particles.

    • Analogy: Like a cylinder, which casts a circular shadow from one angle and a rectangular shadow from another, where the shape you see depends entirely on your perspective.

  • Heisenberg Uncertainty Principle

    • Definition: It is impossible to simultaneously measure with absolute precision certain pairs of physical quantities, such as position and momentum of a particle.

    • Example: Nature itself imposes fundamental limits on the simultaneous knowledge of complementary properties.

    • Analogy: It is like trying to photograph a bouncing ball at high speed: the more clearly you see its position, the less accurately you know its velocity.

  • Superposition

    • Definition: A quantum system can exist in multiple states at the same time until it is measured, at which point it "collapses" into a definite state.

    • Example: An electron in an atom can be in multiple positions or energy states at the same time until it is observed.

    • Analogy: It is like a coin spinning in the air. While it is spinning, it is neither strictly heads nor tails, but a mix of both. Only when it lands, or is measured, does it become either heads or tails.

  • Entanglement

    • Definition: Two or more quantum systems can have correlated states instantaneously, even when separated by large distances.

    • Example: Two entangled particles are far apart. Measuring one instantly tells you the state of the other.

    • Analogy: It is like a pair of perfectly synchronized dice. When you roll one on Earth and it lands on six, the other on Mars shows six at the same instant, with no apparent connection.

  • Pauli Exclusion Principle

    • Definition: Two identical fermions (such as electrons) cannot occupy the same quantum state simultaneously.

    • Example: The electronic structure of atoms, which determines chemistry and material properties.

    • Analogy: It is like numbered seats in a theater. Each person can only sit in their assigned seat and no one can share the same seat at the same time.

  • Wave Function Collapse

    • Definition: Describes all possible probabilities of a quantum system. When measured, it "collapses" into a single outcome.

    • Example: A photon can go through two paths at once but detecting it in one path instantly shows it did not take the other.

    • Analogy: It is like choosing a card from a closed deck. Before opening any card could be on top. When opened only one card appears.

  • Probability and Statistical Interpretation

    • Definition: Quantum phenomena are not deterministic, but described by probability distributions.

    • Example: The position of an electron around a nucleus can only be predicted probabilistically.

    • Analogy: It is like predicting the weather in a city. You cannot know for sure if it will rain, but you can estimate the probability of rain.

  • Quantum Tunneling

    • Definition: Quantum particles can pass through energy barriers that would be impassable in classical physics.

    • Example: Nuclear reactions in the Sun, semiconductor devices like diodes and transistors.

    • Analogy: It is like a ball magically passing through a wall without breaking it, something impossible in everyday life.

  • Principle of Complementarity

    • Definition: Quantum phenomena have complementary aspects, which can only be observed in mutually exclusive ways (like wave or particle).

    • Example: A complete description of the system requires multiple viewpoints.

    • Analogy: It is like a sculpture that reveals different shapes depending on the angle you view it, with each perspective showing only part of reality.

Fundamentals of Quantum Computing

  • Qubit

    • Definition: Basic unit of quantum information. Unlike a classical bit, which takes the value 0 or 1, a qubit can exist in a superposition of 0 and 1, mathematically represented as |ψ⟩ = α|0⟩ + β|1⟩, where |α|² + |β|² = 1.

    • Analogy: A qubit is like a coin spinning in the air: while it spins, it is neither heads nor tails, but a combination of both.

  • Superposition

    • Definition: Property that allows a qubit to be in multiple states simultaneously. Measurement collapses the superposition to a specific state according to probabilities associated with the amplitudes.

    • Analogy: It is like a person being in two rooms at the same time — you only realize which room they are in when you open the door.

  • Measurement

    • Definition: Process of observing a qubit, which collapses the superposition into one of the possible states, with probabilities determined by the amplitudes. It is intrinsically probabilistic.

    • Analogy: Like taking a photo of something in motion, before the photo it is "everywhere" and in the photo it appears in one place only.

  • Entanglement

    • Definition: Phenomenon in which qubits become correlated so that the state of one instantly affects the other, even when separated by large distances. Essential for protocols such as quantum teleportation and quantum cryptography.

    • Analogy: Two friends with synchronized watches that automatically adjust together, regardless of the distance between them.

  • Decoherence

    • Definition: Loss of quantum coherence due to interaction with the environment. This interaction causes the system to lose its ability to maintain superposition and entanglement, returning to classical behavior.

    • Analogy: A perfectly tuned piano that goes out of tune with changes in temperature and humidity.

  • Quantum State

    • Definition: Complete representation of a qubit or system of qubits. It can be expressed as a vector in Hilbert space and contains all information about superposition and correlation with other qubits.

    • Analogy: A detailed map of a maze showing all possible paths simultaneously.

  • Bra-ket (Dirac Notation)

    • Definition: Mathematical convention for representing quantum states: |ψ⟩ (ket) represents the vector, and ⟨ψ∣ (bra) is its conjugate transpose. Facilitates calculations of probabilities and amplitudes.

    • Analogy: Like writing the position and velocity of a car on a detailed map, where the bra is the reading and the ket is the actual position.

  • Probability Amplitude

    • Definition: Complex number associated with each qubit state that determines the probability of occurring when measured. Probability is the squared modulus of the amplitude.

    • Analogy: A bucket of paint mixing colors, where each color represents the chance of appearing in the final result.

Operations and Manipulation

  • Quantum Gates

    • Definition: Operations that transform qubit states. Unlike classical gates, they manipulate superposition and entanglement. Examples: X, Y, Z, Hadamard, CNOT, Toffoli.

    • Analogy: Light filters that change the color and intensity of multiple lights simultaneously.

    • Hadamard Gate (H)

      • Definition: Places a qubit in an equal superposition of |0⟩ and |1⟩. Essential for initializing quantum algorithms.

      • Analogy: A perfectly balanced seesaw that leaves the ball in the middle, able to fall either way.

    • Pauli-X Gate (X)

      • Definition: Equivalent to the classical NOT gate, inverts the state of a qubit: |0⟩ → |1⟩ and |1⟩ → |0⟩.

      • Analogy: A light switch that alternates between on and off.

    • CNOT Gate (Controlled NOT)

      • Definition: Two-qubit gate: flips the second qubit (target) if the first qubit (control) is |1⟩. Enables creation of entanglement.

      • Analogy: A security button that only triggers an alarm if another sensor is activated.

    • Toffoli Gate (CCNOT)

      • Definition: Three-qubit gate that flips the target qubit if both control qubits are |1⟩. Fundamental for universal quantum computing.

      • Analogy: A safe that only opens if two different keys are turned simultaneously.

  • Quantum Interference

    • Definition: Combination of probability amplitudes that can reinforce or cancel certain states, enabling optimization of algorithms.

    • Analogy: Water waves that add and cancel out, creating complex patterns.

  • Unitarity

    • Definition: Property of quantum gates: all reversible quantum operations are unitary, preserving the total probability (vector norm).

    • Analogy: Rotating a Rubik's cube without losing any pieces, just changing their positions.

  • Quantum Teleportation

    • Definition: Process that transfers the quantum state of a qubit to another using entanglement and classical communication, without physically moving the original qubit.

    • Analogy: Copying a file instantly from one computer to another without moving the original.

  • No-Cloning Theorem

    • Definition: Principle that forbids perfect copying of an unknown quantum state. Essential for quantum security.

    • Analogy: Trying to take a perfect photograph of a hologram: you can never reproduce the original exactly.

Quantum Algorithms

  • Grover's Algorithm

    • Definition: Quantum algorithm for searching an unsorted database providing quadratic speedup over classical methods.

    • Analogy: Searching for a specific book in a giant library simultaneously, instead of aisle by aisle.

  • Shor's Algorithm

    • Definition: Quantum algorithm that factors large integers in polynomial time, breaking certain types of classical encryption.

    • Analogy: Quickly finding the secret path in a maze that would be impossible to traverse step by step.

  • Simulation Algorithms

    • Definition: Algorithms that simulate complex quantum systems, like molecules and materials, more efficiently than classical computers.

    • Analogy: Creating a miniature universe to test experiments without affecting the real world.

  • Hybrid Algorithms (VQE, QAOA)

    • Definition: Combination of quantum and classical computing to solve optimization and quantum chemistry problems using short quantum circuits and iterative classical routines.

    • Analogy: A human chef continuously adjusting the temperature of an automated oven until the recipe is perfect.

Quantum Architecture

  • Universal Quantum Computer

    • Definition: Machine capable of executing any quantum algorithm by manipulating qubits with unitary gates.

    • Analogy: A fully equipped kitchen with all tools and ingredients for any recipe.

  • Quantum Processing Unit (QPU)

    • Definition: Quantum processing unit that performs operations on qubits, equivalent to the classical CPU.

    • Analogy: A stage where actors (qubits) perform complex dance movements (quantum operations).

  • Types of Physical Qubits

    • Definition: Different technologies to implement qubits: superconducting circuits, trapped ions, quantum dots, photonics, etc. Each type has advantages and challenges in coherence and scalability.

    • Analogy: Different types of engines for cars: some fast, some durable, some efficient for long distances.

  • Quantum Error Correction

    • Definition: Techniques that protect quantum information against decoherence and noise, using redundant qubits and quantum codes (like Shor, Steane, Surface Codes).

    • Analogy: Using multiple parachutes to ensure that at least one opens correctly.

  • Quantum Circuits

    • Definition: Sequence of quantum gates applied to qubits, equivalent to classical programs representing algorithms.

    • Analogy: A choreography script where each step is crucial for the final result.

  • Repeated Measurement and Readout

    • Definition: Strategy to extract information from qubits probabilistically by collecting statistics from multiple measurements to obtain reliable results.

    • Analogy: Tossing a biased coin several times to estimate its probability of heads or tails.

  • Quantum Topology

    • Definition: Use of topologically protected quantum states to create qubits more robust against noise and decoherence.

    • Analogy: A knot in a rope that maintains its shape regardless of how you twist it.

  • Logical vs Physical Qubits

    • Definition: Physical qubits are real implementations, susceptible to errors. Logical qubits are encoded from multiple physical qubits to form more stable units.

    • Analogy: A team of firefighters working together to ensure that even if one fails, the mission is accomplished.

  • Quantum Communication

    • Definition: Transfer of information securely using quantum principles, such as entanglement and teleportation, to create channels immune to interception.

    • Analogy: Sending a letter that self-destructs if someone tries to read it without permission.

Code

Grover's Algorithm

To simulate 1000 qubits classically, you need $2^{1000}$ complex numbers to represent the state vector.

There are not enough atoms in the observable universe to build a classical computer with that much memory!

Usually, local simulators reach their limit at around 25 to 30 qubits.

Quantum scaling is exponential! Every additional qubit doubles the amount of memory required!

The observable universe contains about $10^{80}$ atoms. A simulation of 1000 qubits would require $10^{301}$ states.

It would take $10^{221}$ universes to turn every atom into 1 bit - and even then, simulation would be impossible!

Qubits States ($2^n$) Memory Required Equivalent
10 $2^{10}$ 16 KB Text File
20 $2^{20}$ 16 MB Photograph
30 $2^{30}$ 16 GB PC
40 $2^{40}$ 1 Trillion 16 TB Storage
50 $2^{50}$ 16 PB Supercomputer
1000 $2^{1000}$ $10^{301}$ Impossible Exceeds Atoms In The Observable Universe

Shor's Algorithm

Cracking RSA-2048 with a classical supercomputer would take about 300 trillion years!

That is about 21k times longer than the age of the universe!

A quantum computer running Shor's Algorithm could theoretically finish the same task in just hours!

Classical computers struggle with Prime Factorization - two primes that multiply into a huge number.

As the number of bits increases, the time required for a classical computer grows exponentially.

Shor's Algorithm changes the game by using Quantum Period Finding.

Instead of testing each factor, it uses quantum interference to find a function's period in one sweep.

  • Classical Approach: Brute-force trial and error (Exponential Time).

  • Quantum Approach: Shor's Period Finding (Polynomial Time).

RSA Key Size Classical Time (Supercomputer) Quantum Time (Shor) Logical Qubits Security
512-bit Minutes - Hours Seconds - Minutes ~1k Broken
1024-bit Centuries - Millennia Hours - Days ~2k - 3k Vulnerable
2048-bit 300 Trillion Years Hours - Days ~4k - 6k Total Collapse
4096-bit Beyond Universe Lifespan Days - Weeks ~8k - 12k Total Collapse