Giter VIP home page Giter VIP logo

qics's Introduction

Qics - Quantum Idealistic Computer Simulator

GitHub issues GitHub license Travis npm Greenkeeper badge

Qics is an Idealistic, Quantum Computer Simulation Library. It works by holding a Quantum Register as a Matrix, and then multiplying that against various Gate Matrices. For more information about the working, see the src directory for the source code, or see examples/node.js or the Usage Section for information on the usage of the module.


Features

  • A 'Universally Complete', Quantum Circuit Based Simulator
  • Gate Expansion Function (To make a single qubit gate work on a register with multiple qubits)
  • Relatively Simple To Use
  • Inline Documentation with Docco

Usage

Currently the library is available using Node.js and NPM. To install the module, use the command:

npm install qics

(NOTE: Works with Node.js Versions >= 4)

If you want to use this in the browser, just add the qics.js or qics.min.js from the dist folder

Then you are able to use the module. When it's installed, Qics exposes two classes, qics.Register and qics.gates.

qics.Register is the main class, and is the basis of the simulator. It is used like any other class using the new keyword. Once initiated, there is a number of methods, see below or the Documentation.

qics.gates exposes all of the single qubit gates as 2D arrays. It also has some static methods, such as generateGate(). Again, see the documentation.

Example simulation:

// Import the module
const qics = require('qics');

// Create a new Quantum Register with 3 Qubits
const reg = new qics.Register(3);

// Apply some gates.
// Hadamard Gate
reg.applyGate('H', 1);
// CNOT Gate, with control as qubit 1, and the
// target as qubit 3
reg.applyGate('CNOT', 1, 3) ;

// Now measure the register. Should return either "000" or "101"
console.log(reg.measure());

You can also use your own gates, by inputing them as an Array or Math.Matrix object to the applyGate function.

// Manually Add A NOT Gate

const reg = new qics.Register(2);

reg.applyGate([
  [0, 1],
  [1, 0]
], 1);


// Now measure the register. Should return either "10"
console.log(reg.measure());

Documentation

This library is documented using Inline Prose Comments, and then generated using Docco. The documentation is just source code comments, but the source isn't too complex, and the functions are quite clear to use.

To read the docs, Checkout Here!

To deploy the docs to the github pages, run

git subtree push --prefix docs origin gh-pages

To build the docs, run npm run docs.


Build

First you need to clone the repo from github:

git clone git://github.com/adamisntdead/qics.git
cd qics

Then install the dependencies:

npm install

Then you can run the build script:

npm run build

This will build the module, and output to the lib folder. If you want to build for client side (i.e. in the browser), run npm run build:all and then it will output qics.js and qics.min.js to the dist folder.

Tests

To run the test for this module, after cloning and installing, run:

npm run test

And it will run all of the tests.

qics's People

Contributors

adamisntdead avatar greenkeeper[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

zhaouvorg

qics's Issues

Version 4 of node.js has been deprecated

Version 4 of Node.js (code name Argon) has been deprecated! 🚑

This means that it is no longer maintained and will not receive any more security updates. Version 6 (Boron) is now the lowest actively maintained Node.js version.
To see what effect this update from 4 to 6 would have on your code, Greenkeeper has already created a branch with the following changes:

  • Upgraded away from the deprecated version in your .travis.yml
  • The engines config in 1 of your package.json files was updated to the new lowest actively supported Node.js version

If you’re interested in removing support for Node.js 4 from this repo, you can open a PR with these changes.

You can find out more about the deprecation and possible update strategies in this Node.js foundation announcement.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • In engines, any occurance of 4 was replaced with 6
  • .nvmrc was updated to Node.js 4
  • .travis.yml was only changed if there was a root-level node_js key that specified Node.js 4. In this case, 4 was replaced with 6. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, these changes should already suffice, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to continue supporting Node.js 4, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of babel-loader is breaking the build 🚨

Version 6.4.1 of babel-loader just got published.

Branch Build failing 🚨
Dependency babel-loader
Current Version 6.4.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As babel-loader is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v6.4.1

🐛 Bug Fix

Commits

The new version differs by 2 commits .

  • 48325ea 6.4.1
  • f3241f8 Fixed reset of BABEL_ENV when options.forceEnv is used (#420)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of mathjs is breaking the build 🚨

Version 3.10.1 of mathjs just got published.

Branch Build failing 🚨
Dependency mathjs
Current Version 3.10.0
Type dependency

This version is covered by your current version range and after updating it in your project the build failed.

As mathjs is a direct dependency of this project this is very likely breaking your project right now. If other packages depend on you it’s very likely also breaking them.
I recommend you give this issue a very high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Commits

The new version differs by 7 commits .

  • 691d555 Released v3.10.1
  • c2597af Removed duplicate dependency
  • a3f2407 Added a section in readme about browser support (see #810)
  • 0e2f3eb Fixed #807: function transform of existing functions not being removed when overriding such a function
  • 6ef89f1 Updated history
  • 9709a50 Merge pull request #805 from litmit/master
  • a531715 Fix xgcd for negative values

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

An in-range update of cross-env is breaking the build 🚨

Version 3.2.0 of cross-env just got published.

Branch Build failing 🚨
Dependency cross-env
Current Version 3.1.4
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As cross-env is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪


Status Details
  • continuous-integration/travis-ci/push The Travis CI build could not complete due to an error Details
Release Notes v3.2.0

<a name"3.2.0">

3.2.0 (2017-03-04)

Features

  • revamp: revamp the entire lib (backward compatible) (#63) (dad00c46)
Commits

The new version differs by 4 commits .

  • dad00c4 feat(revamp): revamp the entire lib (backward compatible) (#63)
  • e33a85c docs(README): Add doc for cross-var. (#58)
  • 5e590ec docs(README): added how to use cross-env to run npm sub-scripts (#53)
  • afdb2de docs(README): mention Bash on Windows (#49)

See the full diff.

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

Version 10 of node.js has been released

Version 10 of Node.js (code name Dubnium) has been released! 🎊

To see what happens to your code in Node.js 10, Greenkeeper has created a branch with the following changes:

  • Added the new Node.js version to your .travis.yml
  • The new Node.js version is in-range for the engines in 1 of your package.json files, so that was left alone

If you’re interested in upgrading this repo to Node.js 10, you can open a PR with these changes. Please note that this issue is just intended as a friendly reminder and the PR as a possible starting point for getting your code running on Node.js 10.

More information on this issue

Greenkeeper has checked the engines key in any package.json file, the .nvmrc file, and the .travis.yml file, if present.

  • engines was only updated if it defined a single version, not a range.
  • .nvmrc was updated to Node.js 10
  • .travis.yml was only changed if there was a root-level node_js that didn’t already include Node.js 10, such as node or lts/*. In this case, the new version was appended to the list. We didn’t touch job or matrix configurations because these tend to be quite specific and complex, and it’s difficult to infer what the intentions were.

For many simpler .travis.yml configurations, this PR should suffice as-is, but depending on what you’re doing it may require additional work or may not be applicable at all. We’re also aware that you may have good reasons to not update to Node.js 10, which is why this was sent as an issue and not a pull request. Feel free to delete it without comment, I’m a humble robot and won’t feel rejected 🤖


FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

An in-range update of mocha is breaking the build 🚨

Version 3.4.0 of mocha just got published.

Branch Build failing 🚨
Dependency mocha
Current Version 3.3.0
Type devDependency

This version is covered by your current version range and after updating it in your project the build failed.

As mocha is “only” a devDependency of this project it might not break production or downstream projects, but “only” your build or test tools – preventing new deploys or publishes.

I recommend you give this issue a high priority. I’m sure you can resolve this 💪

Status Details
  • continuous-integration/travis-ci/push The Travis CI build failed Details

Release Notes v3.4.0

Mocha is now moving to a quicker release schedule: when non-breaking changes are merged, a release should happen that week.

This week's highlights:

  • allowUncaught added to commandline as --allow-uncaught (and bugfixed)
  • warning-related Node flags

🎉 Enhancements

🐛 Fixes

🔩 Other

Commits

The new version differs by 9 commits0.

  • 7554b31 Add Changelog for v3.4.0
  • 9f7f7ed Add --trace-warnings flag
  • 92561c8 Add --no-warnings flag
  • ceee976 lint test/integration/fixtures/simple-reporter.js
  • dcfc094 Revert "use semistandard directly"
  • 93392dd no special case for macOS running Karma locally
  • 4d1d91d --allow-uncaught cli option
  • fb1e083 fix allowUncaught in browser
  • 4ed3fc5 Add license report and scan status

false

See the full diff

Not sure how things should work exactly?

There is a collection of frequently asked questions and of course you may always ask my humans.


Your Greenkeeper Bot 🌴

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.