Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ax1/qclient-node
https://github.com/ax1/qclient-node
Last synced: about 22 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/ax1/qclient-node
- Owner: ax1
- License: mit
- Created: 2021-07-28T13:20:40.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2021-07-29T11:49:30.000Z (over 3 years ago)
- Last Synced: 2025-01-15T00:08:55.010Z (24 days ago)
- Language: JavaScript
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qclient
Client for running quantum applications on qserver instances. See https://quantum.tecnalia.com.
## Install
```sh
npm install qclient-node
```## Usage
```js
import * as q from 'qclient-node'async function test(name) {
q.configure({ server: 'http://localhost:8080', token:'AAA' })
const algorithm = await q.get(name)
const result = await q.execute(name)
const data = '...qasm_or_quil...'
const result = await q.execute(data)
}test('bell').catch(console.error)
```# Methods
- **configure({ server?, ext? ,token? })**: `server`: default server at https://quantum.tecnalia.com. `ext`: default '.qasm', useful in case always using the same language to represent the algorithm. `token`: default '', authorization token to execute services. E.g.: `configure({"token':'kkajsdkj-sudiuawjd...."})`.
- **get(algorithm_name)**: the algorithm in plain text, the extension of the file is optional. E.g.: `get('bell')`.
- **execute(algorithm_name or algorithm_description)**: based on the extension, an engine executes the algorithm and provides the result as string (depending on the engine, the result format can vary). E.g.: `execute('bell')`. If the algorithm is not stored yet, it can be executed by providing the text representation (in qasm, quil, etc.). E.g: execute('...qasm_string').