Giter VIP home page Giter VIP logo

deutch-algorithm's Introduction

Deutch-Jozsa Algorithm

Deutch-Jozza algorithm is a one of the simplest quantum algorithm that solves a particular problem faster than its classical counterpart.

Problem that this algorithm aims to solve

Suppose that there is a binary function , which can be divided into those two following categories.

  1. Constant function

  2. Balanced function If you use this algorithm, you can figure out whether is belonged to which category just by one evaluation, although its classical algorithm takes n trials(n is the binary length of input)

Mathematical explanation

I prepared the oracle in order to judge the function is constant or balanced.
If , this function would be constant and it would be balanced otherwise.

Implementation

Here, I am going to show quantum circuits and codes that I implemented.

Constant function

This is the quantum circuit for a constant function
dj_constant

and this is the result on OpenQASM simulator.
screen shot 2019-01-05 at 10 41 05 am

Also, this is the result on ibmqtokyo20.
screen shot 2019-01-05 at 10 45 22 am

Therefore, this is a constant function.

Balanced function

This is the quantum circuit for a balanced function. screen shot 2019-01-05 at 10 49 07 am

and this is the result on OpenQASM simulator.
screen shot 2019-01-05 at 10 52 18 am

This is the result on ibmq20Tokyo.
screen shot 2019-01-05 at 10 55 33 am

The outcome is not (in most cases) ,therefore, it can be said that this function is balanced.

I also uploaded implementation for Deutch algorithm, which is the Deutsch-Jozsa algorithm for one qubit, feel free to check my code.

deutch-algorithm's People

Contributors

makotonakai 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.