Giter Site home page Giter Site logo

simcount's Introduction

simcount

Quantum algorithms for the simulation of Hamiltonian dynamics.

This repository contains:

  • Implementations of quantum algorithms for the simulation of Hamiltonian dynamics in the Quipper quantum programming language.

  • Sample quantum circuits.

Explicit descriptions of the algorithms, implementation details, and original references can be found in the following paper.

  • Andrew M. Childs, Dmitri Maslov, Yunseong Nam, Neil J. Ross, and Yuan Su. Toward the first quantum simulation with quantum speedup. November 2017. Available from https://arxiv.org/abs/1711.10980.

License

  • The code is released under the Apache License. See the LICENSE and NOTICE files for more information.

Build

The modules require Quipper. See Quipper for download options and installation instructions.

Assuming that Quipper is installed, the main file can be compiled as follows.

quipper Main.hs

Usage

The main function can be used to generate quantum circuits and gather some statistics about them. The options are

  • n, the size of the simulated system (a nonzero integer, default: 50)

  • a, the algorithm to use (default: pf4com)

  • g, the type of gates to use (default: cz)

  • z, the number of rotations to approximate (a nonzero integer, default: 1)

  • f, the output format for circuits (default: gatecount)

  • m, the random seed to use in generating the Hamiltonian (default: 1)

  • h, to print the usage info

Possible values for a are: pf1ana, pf1min, pf1com, pf1emp, pf2ana, pf2min, pf2com, pf2emp, pf4ana, pf4min, pf4com, pf4emp, pf6ana, pf6min, pf6emp, pf8ana, pf8min, pf8emp, ts, qsp, qspja, qspsegment, qspsegmentemp.

Possible values for g are: cz, cz2ct, ct.

Possible values for f are: eps, pdf, ps, postscript, ascii, preview, gatecount.

Restriction: If the chosen simulation algorithm is not qsp, qspja, qspsegment, or qspsegmentemp, then n can be any integer greater than 3. If the algorithm is one of qsp, qspja, qspsegment, or qspsegmentemp, then n must be one of 13, 16, 20, 25, 32, 40, 42, 44, 46, 48 50, 52, 54, 56, 58, 63, 79, or 100. Circuits for other system sizes using the latter algorithms can be obtained by computing the relevant parameters and adding them to the Parameters.hs module. This can be done using the Mathematica notebooks provided in the Mathematica folder.

Usage examples:

  • Preview the pdf of the circuit for the simulation of a system of 10 spins using the 4th order PF algorithm with commutator bound over the Clifford+Rz gate set:

      ./Main -n 10 -a pf4com -g cz -f preview
    
  • Show the gatecounts of the circuit for the simulation of a system of 40 spins using the TS algorithm over the Clifford+Rz gate set:

      ./Main -n 40 -a ts -g cz -f gatecount
    
  • Show the gatecounts of the circuit for the simulation of a system of 50 spins using the segmented QSP algorithm over the Clifford+T gate set:

      ./Main -n 50 -a qspsegment -g ct -f gatecount -z 21237612
    

    Note that in the above command the number of z-rotations has to be precomputed before constructing the circuit which requires counting the number of z-rotations in the corresponding circuit over the Clifford+Rz gate set. This can be achieved by using the cz2ct argument for g which produces circuits over the Clifford+Rz gate set using only half of the allotted precision.

Samples

The compressed folder samples.tar.gz contains sample circuits for the simulation of Hamiltonian dynamics before and after optimization. The optimizations were carried out using the techniques detailed in the following paper.

  • Yunseong Nam, Neil J. Ross, Yuan Su, Andrew M. Childs, and Dmitri Maslov. Automated optimization of large quantum circuits with continuous parameters. October 2017. Available from https://arxiv.org/abs/1710.07345.

The sample circuits are given in the ASCII format of the Quipper language. The circuits correspond to systems of size 13, 16, 20, 25, 32, 40, 50, 63, 79, and 100 and algorithms pf4ana, pf4min, pf4com, pf4emp, pf6emp, ts, qspja, and qspsegment.

Contributors

  • Andrew M. Childs
  • Dmitri Maslov
  • Yunseong Nam
  • Neil J. Ross
  • Yuan Su

Contact

Questions and comments can be addressed to: [email protected]

simcount's People

Contributors

njross avatar

Stargazers

yoga avatar A. Barış Özgüler avatar  avatar Ashutosh Kumar avatar  avatar Clinch Leatherwood avatar Peter_YSQH avatar Jue Xu avatar Li, Mingyang avatar Zeeshan Ahmed avatar Shixin Zhang avatar LittleCY avatar Greenstick avatar Unpil Baek avatar Adrien Suau avatar  avatar Anurag Saha Roy avatar Squirrel avatar Daochen Wang avatar Amit avatar Jim Garrison avatar Victory Omole avatar Rholais Lii avatar Yibo Lin avatar Yupan Liu avatar Ali Panahi avatar Torsten Scholak avatar

Watchers

 avatar Zhiyong Zhang avatar Andrew Childs avatar  avatar paper2code - bot avatar

Forkers

qbit- zyzhang1992

simcount's Issues

Double colon after Outputs in samples

The provided samples tar contains multiple output lines with two colons instead of one, as expected.

Example

From pf4min/pf4min_postoptim_cz_16

Outputs:: 0:Qbit, 1:Qbit, 2:Qbit, 3:Qbit, 4:Qbit, 5:Qbit, 6:Qbit, 7:Qbit, 8:Qbit, 9:Qbit, 10:Qbit, 11:Qbit, 12:Qbit, 13:Qbit, 14:Qbit, 15:Qbit

Expected

The Quipper output only specifies a single colon (:) after the Outputs statement. The Inputs do adhere to the standard.

Files affected

The following files all contain a double colon:

simcount/pf6emp/pf6emp_postoptim_cz_40
simcount/pf6emp/pf6emp_postoptim_cz_25
simcount/pf6emp/pf6emp_postoptim_cz_13
simcount/pf6emp/pf6emp_postoptim_cz_79
simcount/pf6emp/pf6emp_postoptim_cz_100
simcount/pf6emp/pf6emp_postoptim_cz_63
simcount/pf6emp/pf6emp_postoptim_cz_16
simcount/pf6emp/pf6emp_postoptim_cz_20
simcount/pf6emp/pf6emp_postoptim_cz_50
simcount/pf6emp/pf6emp_postoptim_cz_32
simcount/pf4min/pf4min_postoptim_cz_16
simcount/pf4min/pf4min_postoptim_cz_20
simcount/pf4min/pf4min_postoptim_cz_32
simcount/pf4min/pf4min_postoptim_cz_50
simcount/pf4min/pf4min_postoptim_cz_100
simcount/pf4min/pf4min_postoptim_cz_25
simcount/pf4min/pf4min_postoptim_cz_79
simcount/pf4min/pf4min_postoptim_cz_13
simcount/pf4min/pf4min_postoptim_cz_40
simcount/pf4min/pf4min_postoptim_cz_63

where simcount is the root of the tarball.

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.