Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@qiskit/devs

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@qiskit/devs

Quantum Information algorithms for developers

  • 0.3.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
4
Weekly downloads
 
Created
Source

QISKit for developers

:atom_symbol: Quantum Information Software Kit Quantum Information algorithms for developers. The idea is t

Please visit the main repository of the project to know about the rest of the tools.

Install

:coffee: Install Node.js v8 and then:

npm i @qiskit/devs

Use

:pencil: As you can see in the next section, we have to use it like in the rest of independent modules. The only difference is we need to pass the engine as any other option.

const qiskit = require('@qiskit/devs');

// With the default engine and length.
qiskit.random().then(rand => console.log(`Random number(default): ${rand}`));

qiskit
  .random({
    engine: 'anu',
    length: 8,
  })
  .then(rand => console.log(`Random number: ${rand}`));

API

:eyes: Full specification. Here are reflected the common options among the different engines, but some of them can receive (even need) extra ones, ie: an API key. Please check the proper package.

version

The actual version of the library.

  • version (string) - Version number.

async random(opts) -> rand | jobId

Generate a true random number among 0 and 1.

  • opts (object) - Optional parameters:
    • engine (string) - Where to run the operation. Please visit the packages to see the supported ones. The number of digits depends on the selected engine. (default: "js")
    • length (number) - Number of random hex characters to ask for to the engine. As you can see in the doc referenced before each engine has different limit, they will throw in it's overpassed. (default: 16)
    • format (string) - To ask for the result in a different format, supported ("hex").
    • token (string) - Some engines need an access token (visit each specific doc).
  • rand (number) - Generated random number in the desired format if the operation doesn't involves a background job.
  • jobId (string) - Identifier for the generated background job (see next method).

async result(jobId, opts) -> result

Get the result of a background job generated by an algorithm method.

  • jobId (string) - Job identifier got as initial response.
  • opts(object) - Optional parameters:
    • token
  • result (?) - Depending on the used agorithm:
    • "random": (object) - With nex fields:
      • status (string) - To know if the job has finished correctly. Supported: "running", "completed", TODO.
      • data (number) - Generated random number. Only present if "status" is "completed".

async factor(number, opts) -> prime

Integer factorization in prime numbers using Shor's algorithm. Only supported in the local simulator for now. Should be run multiple times until get all primes and if the result is invalid.

  • number (number/string) - Number to factorize, can also be an string (hexadecimal).
  • opts
    • engine
    • token
  • prime (number) - Prime factor of the passed one.

Keywords

FAQs

Package last updated on 07 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc