quantum-viz.js is a configurable tool for rendering quantum circuits using pure HTML.
Перейти к файлу
Andres Paz 0cc9597dbd ado pipeline 2021-06-02 22:32:14 -07:00
.github/workflows Rename workflow file 2021-05-28 16:17:26 -04:00
__tests__ Merge pull request #15 from microsoft/anpaz/clean-json 2021-05-31 13:43:43 -04:00
assets Optimize gif 2020-08-20 12:55:30 -04:00
example Fix number of classical registers in teleport example (#23) 2021-06-02 15:04:45 -07:00
src Rename Sqore to quantum-viz.js (#21) 2021-06-02 12:14:20 -07:00
.eslintignore Add minification for in-browser speed with Webpack 2020-08-13 14:04:30 -04:00
.eslintrc.js Allow custom metadata for each gate 2020-08-14 21:46:30 -04:00
.gitignore Adhere to OSS guidelines 2020-09-15 21:19:23 -04:00
.prettierrc.js Enable linting/formatting with ESLint and Prettier 2020-08-12 23:10:58 -04:00
CONTRIBUTING.md Rename Sqore to quantum-viz.js (#21) 2021-06-02 12:14:20 -07:00
LICENSE.txt Rename Sqore to quantum-viz.js (#21) 2021-06-02 12:14:20 -07:00
README.md Rename Sqore to quantum-viz.js (#21) 2021-06-02 12:14:20 -07:00
jest.config.js Enable linting/formatting with ESLint and Prettier 2020-08-12 23:10:58 -04:00
package.json Rename Sqore to quantum-viz.js (#21) 2021-06-02 12:14:20 -07:00
tsconfig.json Use 1D children array and isConditional flag 2020-08-16 21:21:40 -04:00
webpack.config.js Rename Sqore to quantum-viz.js (#21) 2021-06-02 12:14:20 -07:00

README.md

quantum-viz.js

Licensed under the MIT License PR's Welcome Build Status

quantum-viz.js (or qviz) is a configurable tool for rendering quantum circuits. With the increasing demand for quantum libraries and educational tools, quantum circuits provide an intuitive way to visualize and understand quantum algorithms. quantum-viz.js is a lightweight library that can be easily integrated into any project. It aims to be easily configurable while allowing complex user interactions, such as toggling between different measurement outcomes.

Getting Started

Installation

Install the necessary dependencies with npm install.

Embedding in browser

To use quantum-viz.js in the browser, perform the following steps:

  1. Run npm run build:prod to build the minified JS files.
  2. Include dist/qviz.js or dist/qviz.min.js as a <script> in your HTML.
  3. You can now use qviz in your JavaScript files!

Using with TypeScript

To import quantum-viz.js into your TypeScript project, perform the following steps:

  1. Run npm run build to compile TypeScript source files with the type declaration files.
  2. You can now import the files from lib/index.js!

Example usage

const sampleCircuit = {
    qubits: [
        // ...
    ],
    operations: [
        // ...
    ],
};
const sampleDiv = document.getElementById('sample');
qviz.draw(sampleCircuit, sampleDiv, qviz.STYLES['Default']);

Refer to the example project in the example folder for an example on how to use quantum-viz.js.

Contributing

Check out our contributing guidelines to find out how you can contribute to quantum-viz.js!

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.