Code Monkey home page Code Monkey logo

qiskit_factorization's Introduction

Overview

This project explains Shor's algorithm for factorization, the mathematics principle, link to quantum mechanics and implementation the algorithm with qiskit. There are 4 chapters where first 3 explain the concept and last chapter is executable jupyter notebook using qiskit. https://qiskit.org/documentation/getting_started.html provides qiskit installation instruction.

Content

  1. Chapter 1 describes the steps of Shor's algorithm.
  2. Chapter 2 explains the mathematics principle of transforming factorization problem to period finding.
  3. Chapter 3 shows that given unitary operator to calculate $f_N(x)=a^x \mod N$ and QFT, one can find the period of $f_N(x)$
  4. Chapter 4 implements QFT and unitary operator $f_N$ with qiskit.

Benchmark

Some examples were run with qiskit qasm_simulator on M1 Macbook, Pixelbook and i7-4790 ubuntu PC. The CPU time grows exponentially with number of qubits. In the test, N fits within $2^n$ and $x$ in $a^x \mod N$ run over a range of $2^{n_x}$.

Remark *: due to unknown reason, allocate (n, nx)=(4, 8) qubits caused M1 and i7-4790 run forever while (n, nx)=(5, 8) run normally.

Qubits (n, nx) N a M1 Pixelbook i7-4790
4,8 * 15 7 1m12s
5,8 * 15 7 22s 2m29s 36s
6,12 55 7 1m52s 6m36s 2m13s
8,16 221 7 45m58s 82m09s 25m20s
9,18 437 7 252m26s 465m24s 181m54s
10,20 851 7 8080m

References

N. David Mermin, Quantum Computer Science: An Introduction

Vlatko Vedral, Adriano Barenco and Artur Ekert, Quantum Networks for Elementary Arithmetic Operations

Stackexchange, Is there a simple, formulaic way to construct a modular exponentiation circuit?

Qiskit get start

qiskit_factorization's People

Contributors

thyung avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.