GithubHelp home page GithubHelp logo

chenkenshin / yaqcs-arch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alibaba/yaqcs-arch

0.0 0.0 0.0 195 KB

License: Apache License 2.0

Shell 0.05% C++ 30.85% Python 40.86% C 3.30% Assembly 2.52% Makefile 2.46% Dockerfile 2.46% OpenQASM 17.50%

yaqcs-arch's Introduction

YAQCS Project

Driven by the recognition of the increasingly pivotal role of quantum computing, the YAQCS (Yet Another Quantum Computing Suite) project endeavours to provide a foundational infrastructure. Our modest goal is to support the creation and continuous refinement of digital quantum computers. We strive to offer a platform that nurtures creativity and subtly contributes to the onward journey of quantum computing technology advancement.

Yaqcs Architecture

As a keystone initiative within the YAQCS project, our inaugural module, titled the yaqcs-arch repository, houses an intricate array of specifications and implementations of the system. Currently, our proposed architecture is based on the YAQCS-electronics driver instructions described in this document, which are sent at runtime from a RISC-V CPU to the YAQCS-electronics driver (a driver controlling the underlying YAQCS-electronics) through MMIO.

Current yaqcs-arch repository contains the following components:

  • programs/, a collection of test programs written in C++, demonstrating the use of YAQCS-electronics driver instructions.
  • simulator/, a QEMU-based simulator that emulates YAQCS-electronics driver instructions and interfaces with a backend simulator, for an end-to-end simulation of quantum computation.

Another salient component of the YAQCS project is the Yaqcs Electronics. It manifests our commitment to building a robust control and measurement system, aimed at addressing the complexities of large-scale system synchronization, low-latency execution, and noise mitigation. This system is centered around a real-time digital signal processing core, embedded within a Field Programmable Gate Array (FPGA). This design enables precise timing control, arbitrary waveform generation, qubit state discrimination, and the generation of real-time, qubit state-dependent trigger signals for efficient feedback mechanisms. For an in-depth understanding of the system, we direct you to our publication linked here.

The Yaqcs Electronics is presently undergoing testing at the Quantum Laboratory, DAMO Academy. It seamlessly integrates a RISC-V softcore with our bespoke electronic control and measurement system. We're in the process of updating from the T-head E906 to T-head C908, aiming to optimize our system specifically for superconducting quantum processors.

We are diligently striving towards the launch of the YAQCS-electronics module, anticipated in early 2024.

Installation

This project is based on docker. Use the command below to build the core of this project:

docker build . --target yaqcs_arch -t yaqcs-arch:latest

Please note that building the docker image for the first time is a resource-intensive operation that may take many hours to finish and may need about 10GB of memory. Please adjust the docker settings as necessary.

The automated tests can be done by running python3 -m unittest in the docker image build above:

docker run --rm yaqcs-arch:latest bash -c "source ~/.env/yaqcs/bin/activate && python3 -m unittest"

To manually test this project, run the docker image in interactive mode:

docker run -it --rm yaqcs-arch:latest

This will open an interactive docker shell. All shell commands in the "usage" sections below are supposed to be run in this shell.

Simulator usage

In the interactive docker shell, run

# Activate the python venv
source ~/.env/yaqcs/bin/activate

# First change to the programs directory
cd ../programs/

# Run a program
./test.sh t1_demo

Note that the programs are build for the machine smarth on qemu. To rebuild them for virt, go to the programs folder and run

make clean
make MACHINE=virt

In addition to the console outputs, the values that would be output to the upper PC are also stored in the text file pcie.txt for further automated processing. See tests/test.py for an example on how to read this text file. For more advanced usage of this simulator, please refer to a more detailed tutorial in tutorial.md.

Backends

Currently the simulator supports three different backends:

  • qutip (default), a pulse-level simulator with a simple error model.
  • qutip_qip, a gate-level simulator, currently with no error model.
  • stim, a more efficient gate-level simulator, but only for Clifford gates (and also with no error model currently).

To use a backend other than qutip, use the option --backend=<BACKEND> with test.sh:

# Note: Since there is no error model, all measurement results would be 1000
./test.sh -q stim t1_demo

Topologies

The qmemory_experiment test program cannot be directly run, because it requires a different qubit topology than the rest of the test programs. In order to run qmemory_experiment:

# Change the qubit topology the backend simulator uses
make qec

./test.sh -q stim qmemory_experiment

The test program itself uses some constant macros which depend on the size of the QEC. In order to try a different QEC size, you need to rebuild both the qubit topology file and the test program, which can be done by:

# The "-B" option forces a rebuild
make -B qec QEC_SIZE=7

./test.sh -q stim qmemory_experiment

Afterwards, to run non-QEC test programs, you need to switch back to the default qubit topology:

make default_topology

See simulator/programs/Makefile for a full list of test programs.

For developers

The qmemory_experiment test program includes the header file qec.h, which is generated by running make qec in the docker shell. If you need this file outside of the docker image for any reason, you can run:

# Note the ".h" extension
make qec.h

This will also generate qec_topology.json, but will not change the qubit topology used by the pulse simulator. Both files generated by make qec.h are in .gitignore.

Contributing

Contributions, issues, and feature requests are warmly welcomed. Should you wish to contribute, please feel free to check our issues page.

License

The primary project is licensed under the Apache License, Version 2.0. For more details, please refer to the LICENSE file. The software in programs/ directory is optimized for a dedicated system built on yaqcs-electronics.

The simulator in simulator/ directory, on the other hand, is covered under the GPL 3.0 license.

yaqcs-arch's People

Contributors

fangzh-umich avatar maxxungao avatar alibaba-oss avatar chenkenshin 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.