Giter Club home page Giter Club logo

non-clifford-state-prep's Introduction

Fault-tolerant non-clifford gates using error detection

Manuscript

Source code for paper: Fault Tolerant Non-Clifford State Preparation for Arbitrary Rotations

Credit note: Part of the source code is built upon software from Virtualized Logical Qubits: A 2.5D Architecture for Error-Corrected Quantum Computing, from cduck/VLQ

Install

  1. Clone this repository

    git clone https://github.com/yongshanding/vlq
    cd vlq
  2. Install Julia (tested with 1.4.2): julialang.org/downloads

  3. Set path environment. In ~/.bashrc:

    export PATH="$PATH:/path/to/<Julia directory>/bin"
  4. Install required Julia packages (run from the vlq/ directory) from the julia REPL:

    Pkg.update()
    ENV["PYTHON"]=""; Pkg.build("PyCall")
    ] activate .; instantiate
  5. (Optional) Install packages globally from julia REPL:

    add LightGraphs BlossomV ChpSim OrderedCollections PyPlot

Usage

Run the following Julia code on (slurm) server:

# On command line
# For interative testing:
# julia --project=. -e 'import Pkg; Pkg.instantiate(); ENV["SLURM_ARRAY_TASK_ID"]=1; ENV["SLURM_CPUS_PER_TASK"]=1; include("src/run.jl")'

# Running bash script:
sbatch jobs_slurm.sh

Run the following Julia code in a REPL (start one with julia --project=.)

#Setup

include("make_plots_distributed.jl")

using .MakePlots

println("Ready to set up workers.")
flush(stdout)
MakePlots.setup() # setup workers based on cpu counts

#Run simulation

d_tasks = 1 # 1 - 3

job_id = "rz_0.001"
samples = 1000 * 30000 # 20,000 samples take about 1min per cpu (1 plot, 1 dist, 10 angles)
dists = [(1 + 2 * d_tasks):2:(2 + 2 * d_tasks)...] # code distance: 3 or 5 or 7 separately
plots = [4] # list of plot types
plot_id = 4 # type of plots to be made

println("Simulation begins... (", samples, " samples)")
flush(stdout)

results = MakePlots.dist_calc_all(job_id, dists, samples, plots) # start computing and wait until complete
println("Simulation completed.")

collected = MakePlots.fetch_finished(results, job_id, plot_id)
println(collected)

non-clifford-state-prep's People

Contributors

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