Code Monkey home page Code Monkey logo

quasar's Introduction

quasar

Quantum Computation Simulator as a Service

Deploying to Cloud Run

$ export PROJECT_ID=YOUR_GOOGLE_CLOUD_PROJECT_ID
$ export LOCATION=YOUR_GOOGLE_CLOUD_LOCATION
$ export IMAGE=${LOCATION}-docker.pkg.dev/${PROJECT_ID}/quasar/app
$
$ gcloud builds submit --config cloudbuild.yaml --substitutions=_IMAGE=${IMAGE},_TAG=latest .
$ gcloud run deploy --image ${IMAGE} --set-env-vars=PROJECT_ID=${PROJECT_ID} quasar

Example

$ cat testdata/bell.qasm
OPENQASM 3.0;

gate h q { U(pi/2.0, 0, pi) q; }
gate x q { U(pi, 0, pi) q; }
gate cx c, t { ctrl @ x c, t; }

qubit[2] q;
reset q;

h q[0];
cx q[0], q[1];
$ curl -s $(gcloud run services describe quasar --format 'value(status.url)') -X POST -F file=@testdata/bell.qasm | jq .
{
  "state": [
    {
      "amplitude": {
        "real": 0.7071067811865476,
        "imag": 0
      },
      "probability": 0.5000000000000001,
      "int": [
        0
      ],
      "binary_string": [
        "00"
      ]
    },
    {
      "amplitude": {
        "real": 0.7071067811865475,
        "imag": 0
      },
      "probability": 0.4999999999999999,
      "int": [
        3
      ],
      "binary_string": [
        "11"
      ]
    }
  ]
}
$ curl -s -H $(gcloud run services describe quasar --format 'value(status.url)')/shor/15 | jq .
{
  "N": 15,
  "a": 13,
  "m": "0.010",
  "p": 3,
  "q": 5,
  "s/r": "1/4",
  "seed": -1,
  "t": 3
}

quasar's People

Contributors

dependabot[bot] avatar itsubaki avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

quasar's Issues

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.