npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

ibm-quantum-js

v0.1.7

Published

A node.js module to interact with the IBM Quantum API.

Downloads

12

Readme

IBM Quantum JS

This module provides a set of functions to help JavaScript Developers working on IBM Quantum Experience projects to authenticate and access API endpoints using Javascript promises.

Requirements (MacOS/Windows)

  • Node v12.x
  • npm v6.x
  • Standard account on IBM Quantum Experience portal

Note: Depending on your Windows setup windows-build-tools may need to be installed first. Also, for MacOS users, you should have xcode-select or entire Xcode App installed.

Install

$ npm install ibm-quantum-js

Uninstall

$ npm uninstall ibm-quantum-js

Change Log

  • 0.1.7

    • Fixed security vulnerabilities
  • 0.1.6

    • Fixed security vulnerability on ws
  • 0.1.5

    • Fixed security vulnerability on host-git-info, underscode, and lodash
  • 0.1.4

    • Fixed security vulnerability on lodash dependency
  • 0.1.3

    • First working module

Usage

Perform a login on IBM Q Experience API with API_TOKEN and get a valid auth token:


const quantum = require('ibm-quantum-js');

const token = await quantum.loginWithToken(API_TOKEN);

Note: API_TOKEN is created after you validate your IBM Q Experience user ID. You can find it under "My Account" in the IBM Q Experience web site.

Define a function to return user information from IBM Q:

const quantum = require('ibm-quantum-js');

const userInformation = function(token) {
  return quantum.getUserInfo(token).then(function(result){
    return result;
  }).catch(function(error){
    return error;
  });
};

Get IBM Q backends (processors):


const backends = await quantum.getIBMBackends(token);

Get IBM Q backend queue status:


const processor = backends[0].name || 'ibmq_qasm_simulator';

const queueStatus = await quantum.getIBMBackendQueue(processor);

Get user experiments from IBM Q:


const userExperiments = await quantum.getUserExperiments(token);

List user jobs in the IBM Q:


const userExperiments = await quantum.listUserJobs(token);

Cancel an user job in the IBM Q:


const userExperiments = await quantum.cancelUserJob(token, jobId);

Execute a new user job in the IBM Q:


const token = await quantum.loginWithToken(API_TOKEN);

const userExperiments = await quantum.postUserJob(token, jobInfo, jobQObject);

Note: jobQObject is JSON object resulted from a compiled QASM (Quantum Assembly) code. jobInfo indicates which backend/processor to use.


const JOB_INFO = {
  allowObjectStorage: true,
  backend: {
    name: 'ibmq_qasm_simulator'
  }
};

Show the results of a COMPLETED user job in the IBM Q:


const token = await quantum.loginWithToken(API_TOKEN);

const userExperiments = await quantum.showUserJobResults(token, jobId);

List of functions available

  • loginWithToken(API_TOKEN)
  • getIBMBackends(token)
  • getIBMBackendQueue(processor)
  • getUserInfo(token)
  • getUserExperiments(token)
  • cancelUserJob(token, jobId)
  • listUserJobs(token)
  • postUserJob(token, jobInfo, jobQObject)
  • showUserJobResults(token, jobId)

QObject versus QASM

  • Unfortunately there's no available API to compile a QASM into a QOBJ, however its JSON schema is published here.

Contributing

If you want to contribute to the module and make it better, your help is very welcome. You can do so submitting a Pull Request.

Authors

Written by Rod Anami [email protected], May 2020. Contributor(s): Paco Martin [email protected]

License

This project is licensed under the IBM Public License.