Home Blog Page 252

Today in History – 28 October

1
Today in History - 28 October

Today in History - 28 October

1492

Christopher Columbus discovers Cuba and claims it for Spain

1538

The first university in the New World, the Universidad Santo Tomas de Aquino, was established on Hispaniola.

1627

Jahangir, Mughal emperor, weak from asthma and no food, died at Bhimghar near Kashmir. He was buried at Shahdara (Lahore) on the banks of the Ravi.

1848

The first railroad in Spain – between Barcelona and Mataró – was opened.

1811

Yashwantrao Holkar, a diplomat of Peshwa kingdom, died.

1867

Swami Vivekanand Sister Nivedita, great freedom fighter, revolutionary and politician, was born at Dunganon in Ireland.

1888

Gandhiji reaches London. Lives on vegatarian diet. Takes lessons in dancing and music for a short time, thinking they are necessary parts of a gentleman’s equipment.

1914

Omega Psi Phi Fraternity, founded at Howard University, incorporates

1922

First US coast-to-coast radio broadcast of a football game

1922

Benito Mussolini took control of the government of Italy.

1946

Gandhiji leaves for Calcutta. Riots break out in Bihar.

1947

Sheikh Mohammad Abdulla invited to form an interim government in J&K.

1962

US pledges to rush arms to India.

1974

Luna 23 launched (landing on Moon)

1981

Underground Metro Train Compartments were tested on trial basis at Calcutta.

1982

NASA launches RCA-E

1992

Karnataka government withdraws order allowing nine private organisations to start capitation fee for engineering colleges.

1997

Cabinet permits RBI to issue rupee notes of 1000 denomination.

1997

Gold import placed under Open General Licence.

1999

Insurance Bill is introduced amid protest in the Lok Sabha.

2009

NASA successfully launches the Ares I-X mission, the only rocket launch for its later-cancelled Constellation program.

Also Read:

Today in History – 27 October

Today in History – 26 October

Today in History – 25 October

Today in History – 24 October

Shor’s Factoring Algorithm

0

Table of Contents

  1. Introduction
  2. Background: Integer Factorization Problem
  3. Classical Complexity
  4. Quantum Advantage and Shor’s Breakthrough
  5. Problem Statement
  6. High-Level Overview of Shor’s Algorithm
  7. Mathematical Foundations
  8. Role of Modular Arithmetic
  9. Reduction to Order Finding
  10. Quantum Order Finding Subroutine
  11. Phase Estimation Connection
  12. Quantum Circuit Layout
  13. Initialization and Superposition
  14. Modular Exponentiation Circuit
  15. Quantum Fourier Transform (QFT)
  16. Measurement and Period Extraction
  17. Classical Post-Processing
  18. Finding Factors from the Period
  19. Example: Factoring 15
  20. Success Probability and Repetition
  21. Assumptions and Oracle Use
  22. Practical Challenges
  23. Impact on Cryptography (RSA)
  24. Experimental Implementations
  25. Conclusion

1. Introduction

Shor’s Algorithm, developed by Peter Shor in 1994, is a quantum algorithm for integer factorization. It revolutionized cryptography by demonstrating that quantum computers can solve problems in polynomial time that are intractable for classical computers.


2. Background: Integer Factorization Problem

Given an integer \( N \), the task is to find its non-trivial prime factors. For large \( N \), such as those used in RSA encryption, no efficient classical algorithm is known.


3. Classical Complexity

The best-known classical algorithms for factoring, such as the General Number Field Sieve, operate in sub-exponential time:

\[
\exp\left((\log N)^{1/3}(\log \log N)^{2/3}\right)
\]


4. Quantum Advantage and Shor’s Breakthrough

Shor’s algorithm can factor integers in polynomial time:

\[
\mathcal{O}((\log N)^2 (\log \log N)(\log \log \log N))
\]

This poses a serious threat to RSA encryption.


5. Problem Statement

Given a composite number \( N \), find a pair of non-trivial factors \( p, q \) such that \( N = p \cdot q \).


6. High-Level Overview of Shor’s Algorithm

The algorithm has two parts:

  1. Classical Part:
  • Randomly select an integer \( a \)
  • Use quantum subroutine to find the order \( r \) of \( a \mod N \)
  • Use \( r \) to compute non-trivial factors
  1. Quantum Part:
  • Find the period \( r \) of the function \( f(x) = a^x \mod N \) using a quantum circuit

7. Mathematical Foundations

The algorithm uses properties of periodicity:

  • \( f(x) = a^x \mod N \) is periodic with period \( r \)
  • If \( r \) is even and \( a^{r/2} \not\equiv -1 \mod N \), then:
    \[
    \gcd(a^{r/2} \pm 1, N)
    \]
    gives a non-trivial factor of \( N \)

8. Role of Modular Arithmetic

All calculations are modulo \( N \), especially the function \( f(x) = a^x \mod N \), which is efficiently implementable on a quantum circuit.


9. Reduction to Order Finding

The key insight is: factoring reduces to finding the order \( r \), the smallest integer such that:

\[
a^r \equiv 1 \mod N
\]

Quantum computers can find this efficiently using phase estimation.


10. Quantum Order Finding Subroutine

To find \( r \), use two registers:

  • First register: holds input superposition \( |x\rangle \)
  • Second register: holds \( a^x \mod N \)

Compute:

\[
\frac{1}{\sqrt{Q}} \sum_{x=0}^{Q-1} |x\rangle |a^x \mod N\rangle
\]


11. Phase Estimation Connection

Apply Quantum Fourier Transform (QFT) to the input register. The resulting measurement yields a value close to:

\[
\frac{k}{r}
\]

Use continued fractions to extract \( r \) from the measured result.


12. Quantum Circuit Layout

  1. Hadamard gates on input register
  2. Modular exponentiation as a controlled operation
  3. Inverse QFT
  4. Measurement of input register

13. Initialization and Superposition

Apply Hadamards to create uniform superposition:

\[
\frac{1}{\sqrt{Q}} \sum_{x=0}^{Q-1} |x\rangle
\]

where \( Q = 2^n \), for some \( n > \log^2 N \)


14. Modular Exponentiation Circuit

Controlled unitary gates compute \( a^x \mod N \). These circuits use:

  • Controlled multipliers
  • Modular adders
  • Modular multipliers

15. Quantum Fourier Transform (QFT)

The QFT transforms basis states:

\[
|x\rangle \rightarrow \frac{1}{\sqrt{Q}} \sum_{k=0}^{Q-1} e^{2\pi i xk/Q} |k\rangle
\]

Used to extract periodicity encoded in the amplitudes.


16. Measurement and Period Extraction

Measure the first register. With high probability, the outcome is close to a rational approximation of \( k/r \). Using continued fractions, we recover \( r \).


17. Classical Post-Processing

Once \( r \) is found:

  • Check if \( r \) is even
  • Compute \( a^{r/2} \)
  • Use:
    \[
    \gcd(a^{r/2} \pm 1, N)
    \]
    to get the factors

18. Finding Factors from the Period

If \( r \) is valid:
\[
\gcd(a^{r/2} – 1, N) \quad \text{and} \quad \gcd(a^{r/2} + 1, N)
\]
yield the non-trivial divisors.


19. Example: Factoring 15

Let \( a = 2 \)

  • \( a^1 = 2 \mod 15 \)
  • \( a^2 = 4 \)
  • \( a^3 = 8 \)
  • \( a^4 = 1 \Rightarrow r = 4 \)

\[
a^{r/2} = 2^2 = 4 \Rightarrow \gcd(4 – 1, 15) = 3, \quad \gcd(4 + 1, 15) = 5
\]

Thus, 15 = 3 × 5.


20. Success Probability and Repetition

Algorithm may fail if:

  • \( r \) is odd
  • \( a^{r/2} \equiv -1 \mod N \)

Repeating with different \( a \) increases success probability.


21. Assumptions and Oracle Use

  • Assumes modular exponentiation is efficiently implementable
  • Oracle here is the modular function \( a^x \mod N \)

22. Practical Challenges

  • Large number of qubits required
  • Precision of QFT and modular arithmetic
  • Error correction in realistic settings

23. Impact on Cryptography (RSA)

RSA’s security is based on factoring being hard classically. Shor’s algorithm shows that with a scalable quantum computer, RSA can be broken.


24. Experimental Implementations

Shor’s algorithm has been demonstrated on small numbers (e.g., 15, 21) using:

  • Ion trap qubits
  • Superconducting circuits
  • Photonic systems

But scaling to large \( N \) remains an engineering challenge.


25. Conclusion

Shor’s Algorithm represents a pivotal achievement in quantum computing. It offers exponential speedup over classical factoring, has profound implications for modern cryptography, and is a key motivation behind the race to build scalable quantum hardware.


.

Today in History – 27 October

0
Today in History - 27 October

 

1553

Michael Servetus, who discovered the pulmonary circulation of the blood, was burned for heresy in Switzerland.

1612

A Polish army that invaded Russia capitulates to Prince Dimitri Pojarski and his Cossacks.

1806

Emperor Napoleon enters Berlin.

1870

The French fortress of Metz surrenders to the Prussian Army.

1907

The first trial in the Eulenberg Affair ends in Germany.

1907

Sardar Bhagat Singh, the great martyr, was born in village Banga, Lyallpur (now in Pakistsan) in a reputed Sikh freedom fighter’s family.

1907

Brahma Bandhav Upadhyay died.

1927

Fox Movie-tone news, the first sound news film, was released.

1947

Indian Governments accepts King of Jammu and Kashmir Maharaja Harisingh’s accession merging Jammu and Kashmir in India and sends its troops.

1954

Benjamin O. Davis Jr. becomes the first African-American general in the US Air Force.

1971

The Democratic Republic of the Congo renamed Zaire.

1973

The first Ladies Police Station started functioning at Calicut in Kerala.

1982

Gandhiji’s personal secretary Pyare Lal died.

1989

The XIV-World Congress of Neurology was held in New Delhi under the auspices of the World Federation of Neurology and Neurology Society of India. (21-10-89).

1999

P.M. Sayeed of the Congress(I) re-elected as the Deputy Speaker of the Lok Sabha.

1999

The Archbishop of Delhi rules out Pope John Paul II’s dialogue with the VHP during his visit to India in November.

1999

Bahujan Samaj Party (BSP) in Madhya Pradesh splits.

Also Read:

Today in History – 26 October

Today in History – 25 October

Today in History – 24 October

Today in History – 22 October

Quantum Oracle Design

0

Table of Contents

  1. Introduction
  2. What Is a Quantum Oracle?
  3. Role in Quantum Algorithms
  4. Oracle as a Black Box
  5. Mathematical Definition
  6. Oracle for Boolean Functions
  7. Oracle Types: Phase and Bit Flip
  8. Oracle in Deutsch and Deutsch-Jozsa Algorithms
  9. Oracle in Grover’s Algorithm
  10. Oracle in Simon’s Algorithm
  11. Oracle in Bernstein-Vazirani
  12. Oracle for Shor’s Algorithm
  13. Designing Classical Functions as Quantum Oracles
  14. Oracle Reversibility
  15. Ancilla and Garbage Bits
  16. Circuit-Based Oracle Implementation
  17. Controlled and Multi-Controlled Gates
  18. Cost of Oracle Construction
  19. Phase Kickback Mechanism
  20. Oracle and Interference
  21. Oracle and Uncomputation
  22. Limitations and Assumptions
  23. Practical Constraints in Real Hardware
  24. Tools for Oracle Synthesis
  25. Conclusion

1. Introduction

A quantum oracle is a fundamental concept in quantum computing. It is an abstract black-box unitary operator that encodes a function or a rule used within an algorithm. Oracles are critical in quantum algorithms like Grover’s, Simon’s, and Deutsch-Jozsa.


2. What Is a Quantum Oracle?

An oracle \( U_f \) implements a Boolean function \( f : \{0,1\}^n \rightarrow \{0,1\} \) on a quantum computer without disclosing how the function is implemented internally.


3. Role in Quantum Algorithms

Quantum algorithms often assume the oracle exists and focus on how many times it needs to be queried — a key metric for comparing quantum and classical complexities.


4. Oracle as a Black Box

The oracle is treated as a black box, meaning:

  • The algorithm cannot look inside it.
  • It only queries the oracle by applying a unitary transformation.

5. Mathematical Definition

A typical oracle for function \( f(x) \) acts as:

\[
U_f |x\rangle|y\rangle = |x\rangle|y \oplus f(x)\rangle
\]

This transformation must be reversible and unitary.


6. Oracle for Boolean Functions

If \( f(x) \) is a classical function with binary output, it can be embedded into a quantum system using an ancilla qubit as the output register.


7. Oracle Types: Phase and Bit Flip

Two common oracle encodings:

  • Bit flip oracle: modifies a second register
    \[
    U_f |x\rangle|y\rangle = |x\rangle|y \oplus f(x)\rangle
    \]
  • Phase oracle: encodes result in phase
    \[
    U_f |x\rangle = (-1)^{f(x)} |x\rangle
    \]

The second form is more common in algorithms like Grover’s.


8. Oracle in Deutsch and Deutsch-Jozsa Algorithms

Used to distinguish whether \( f(x) \) is constant or balanced:

  • Entangles input/output registers
  • Hadamard gates extract global behavior

9. Oracle in Grover’s Algorithm

Marks the correct solution \( x_0 \) by flipping its sign:
\[
U_f |x\rangle = (-1)^{f(x)} |x\rangle
\]

Must flip the amplitude of the solution state only.


10. Oracle in Simon’s Algorithm

The oracle is 2-to-1 with a hidden XOR mask \( s \):
\[
f(x) = f(x \oplus s)
\]
The oracle encodes the structure needed to infer \( s \).


11. Oracle in Bernstein-Vazirani

The oracle encodes:
\[
f(x) = a \cdot x \mod 2
\]
Phase flip based on dot product. Only one query is needed.


12. Oracle for Shor’s Algorithm

In Shor’s, the oracle performs modular exponentiation:
\[
U_f |x\rangle = |f(x)\rangle = |a^x \mod N\rangle
\]

This is a more complex and structured oracle.


13. Designing Classical Functions as Quantum Oracles

To convert a classical function into a quantum oracle:

  1. Ensure function is reversible
  2. Add ancilla (helper qubits) if needed
  3. Construct reversible gate logic using Toffoli, CNOT, X, etc.

14. Oracle Reversibility

Quantum operations must be reversible. This implies:

  • No information loss
  • Gate constructions must allow backward computation

15. Ancilla and Garbage Bits

Reversible computation can generate garbage bits — unwanted qubits containing intermediate values. These must be uncomputed to maintain coherence.


16. Circuit-Based Oracle Implementation

Real oracles are constructed using basic gates:

  • CNOT, Toffoli, X for classical logic
  • Controlled-Z, T, H for phase encoding
  • Ancilla wires for output preservation

17. Controlled and Multi-Controlled Gates

Complex logic is built using:

  • Multi-controlled NOTs
  • Cascaded control logic
    These emulate classical branching logic in a reversible manner.

18. Cost of Oracle Construction

In practical terms:

  • Oracle design can dominate algorithm complexity
  • Depth, width, and T-gate count matter
  • Fault-tolerant circuits often need optimization of oracle logic

19. Phase Kickback Mechanism

The phase kickback trick is used in many quantum algorithms to encode output into phase:

  • Operate on an ancilla qubit in state \( (|0\rangle – |1\rangle)/\sqrt{2} \)
  • Oracle effect kicks phase back to input register

20. Oracle and Interference

The key power of oracles comes from:

  • Superposition: evaluate \( f(x) \) on many inputs at once
  • Interference: eliminate wrong answers and amplify correct ones

21. Oracle and Uncomputation

To prevent entanglement and decoherence:

  • Intermediate values must be uncomputed
  • Ensures input registers are not entangled with output junk

22. Limitations and Assumptions

  • Oracle is assumed to be available
  • May not always be constructible efficiently
  • Complexity of oracle may offset benefits of quantum speedup

23. Practical Constraints in Real Hardware

  • Real quantum hardware imposes limits on:
  • Number of qubits
  • Connectivity between qubits
  • Native gate set
  • Oracles may require approximation or decomposition

24. Tools for Oracle Synthesis

Quantum development frameworks support oracle synthesis:

  • Qiskit: classicalfunction decorator and transpilers
  • Cirq: custom gates via Gate class
  • QuTiP, RevKit, and LIQUi|> for advanced synthesis

25. Conclusion

Quantum oracles are foundational tools in quantum algorithm design. They bridge classical problem statements and quantum mechanics through reversible logic and phase manipulation. Mastering oracle construction is essential for leveraging the true power of quantum computing.


.

Today in History – 26 October

1
Today in History - 26 October

 

1774

The first Continental Congress, which protested British measures and called for civil disobedience, concludes in Philadelphia.

1814

British General Governor declared war against Nepal.

1825

The first boat on the Erie Canal leaves Buffalo, N.Y.

1891

Padmabhushan Vaikunthbhai Mehta, famous Gandhian leader, was born.

1930

Gulal Bai Parekar, a14-year-old girl led a 13-girls team to hoist the national flag at Esplanade Park. A police sargeant tried to snach the flag and then kidnapped her.

1934

Akhil Bharatiya Gramin Udyog Sangh (All India Small Scale Industries Association) was founded and inaugrated by Mahatma Gandhi.

1943

Cholera epidemic killed 2,155 people in the third week of October at Calcutta.

1950

Mother Teresa founded Mission of Charity in Calcutta, India.

1955

The Village Voice was first published, backed in part by Norman Mailer.

1958

The first New York – Paris transatlantic jet passenger service is inaugurated by Pan Am, while the first New York – London transatlantic jet passenger service is inaugurated by BOAC.

1961

Heavy fighting flared up between India and Communist China in their three-year-old dispute over border lines in the Himalayas. Each side accused the other of initiating the fighting that began along the Tibetan border early in October.

1962

After Chinese attack, Emergency and Defence of India Ordinance was declared for the first time in India by the President.

1969

Neil Armstrong, the first men to land on Moon by ‘Apollo II ‘, and Edwin Aldrin came to Bombay.

1994

Israel and Jordan sign a peace treaty.

1999

India is re-elected to United Nations Environment Programme (UNEP).

1999

The Government rejected the demand that Rajiv Gandhi’s name be deleted from the chargesheet in the Bofors case.

Also Read:

Today in History – 25 October

Today in History – 24 October

Today in History – 22 October

Today in History – 21 October