Git Product home page Git Product logo

qft's Introduction

Quantum Fourier transform

This project is based on the construction of an algorithm to execute the Fourier Quantum transform of n qubits starting from a defined initial state. Any comments or ways to improve the code is completely welcome.

Getting Started

To execute this project, you can clone the repository and execute the following command-line commands:


clang++ -std=c++11 main.cpp -o main

./main

Notes: This project uses C ++ 11 and it was successfully tested on a macOS Mojave (for other OS g++ can be used ). There is a variable called MAX_QUBITS that must be modified by the maximum number of qubits that allows the machine in which the algorithm is running

Description

In the main.cpp file, the object of the QRegister class is instantiated, which contains the initial states of each of the qubits that are part of the quantum register.

For example:

QRegister qreg ({{0,1}, {1,0}, {1 / sqrt (2), 1 / sqrt (2)}, {1 / sqrt (2), -1 / sqrt (2)}, { 1 / sqrt (2), {0,1 / sqrt (2)}}});

Corresponds to a circuit with the following initial states:

initial states

The function getStateVector() returns the resulting state vector that is obtained from the tensor product between the initial states of the circuit or application of the quantum gates, for this specific case, after applying the gate QFT.

This resulting vector is similar to the matrix of final amplitudes obtained in the Quirk simulator with which the results of the execution can be compared.

The applyQFT () function is the function applied by the respective matrix associated with the Fourier Quantum Transform on the number of qubits initially defined in the quantum register.

qft's People

Contributors

andrezgiraldoc avatar

Watchers

James Cloos 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.