Giter Site home page Giter Site logo

abstraqt's Introduction

Abstraqt

Dependencies

We provide a docker image providing all dependencies for Abstraqt. To create the docker image and enter its container, run (you may need sudo):

make -C docker run

Alternatively, to develop Abstraqt, install conda and the dependencies in the Dockerfile.

Installation

Inside the docker container, run:

time bash ./install-pip.sh  # install Abstraqt
rm -rf QuiZX/quizx && git clone https://github.com/Quantomatic/quizx.git QuiZX/quizx && cd QuiZX/quizx && git checkout 81e9e63 && cd - && make -C QuiZX/wrapper  # build QuiZX
cd baseline_yp21/v8; bash ./clean.sh; javac Main.java; cd -  # build YP21

This takes around half a day, as it includes running extensive tests and some pre-computation.

Usage

from abstraqt.stabilizer.abstract_stabilizer_plus import AbstractStabilizerPlus


state = AbstractStabilizerPlus.zero_state(2)

state = state.conjugate('X', 0)
state = state.conjugate('CNOT', 0, 1)
state = state.conjugate('T', 0)
state = state.compress(1)
state = state.measure('Z', 0)  # project to |0⟩
probability_range = state.get_trace()

print(probability_range)

Evaluation

To reproduce the results from our evaluation of Abstraqt, simply run

/usr/bin/time -v python abstraqt/experiments/run_experiments.py --max-processes 1

This takes multiple days, even when using 20 processes (see flag above), as it includes running multiple slow baselines. Using 20 processes is only an option if enough cores (>20) and enough memory (~100GB) is available.

Memory Usage

To determine the memory usage of Abstraqt, run:

/usr/bin/time -v python abstraqt/experiments/run_experiments.py --tool abstraqt

Generate Benchmarks

To regenerate a fresh benchmark from scratch:

# optional: cleanup old benchmarks
cd abstraqt/experiments/circuits; rm *.qasm *.q *.qc *.csv; git checkout *.qasm *.q *.qc *.csv; cd -; git status
# generate
python abstraqt/experiments/generate_circuits.py --repeat 10

abstraqt's People

Stargazers

 avatar  avatar

Watchers

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