qstone.connectors package

Subpackages

Submodules

qstone.connectors.connection module

Connection abstraction for nodes.

class qstone.connectors.connection.Connection[source]

Bases: ABC

Abstract class to represent connection between nodes

abstract postprocess(message: str) dict[source]

Postprocess the data

abstract preprocess(qasm_ptr: str) str[source]

Preprocess the data.

abstract run(qasm_ptr: str, reps: int, mode: str, qpu_host: str, qpu_port: int, compiler_host: str, compiler_port: int, target: str, lockfile: str) dict[source]

Run the connection to the server

class qstone.connectors.connection.FileLock(lockfile: str)[source]

Bases: object

Implementation of the file locking system.

acquire_lock() bool[source]

Tries to acquire the lock. Atomic way

release_lock()[source]

Releases the lock.

qstone.connectors.connector module

Connectors for different Quantum Stacks

class qstone.connectors.connector.Connector(conn_type: ConnectorType, mode: str, qpu_host: str, qpu_port: int, compiler_host: str, compiler_port: int, target: str, lockfile: str | None)[source]

Bases: object

Class used to hold connection between HPC compute node and Quantum bridge

property address

Returns the address of the Quantum bridge device

property compiler_host

Returns the compiler host name

property compiler_port

Returns the compiler_port

property connection

Returns the server_port

property lockfile

Returns the lockfile information

property mode

Returns the mode in use (EMULATION, REAL, RANDOM)

property protocol

Returns the protocol information

property qpu_host

Returns the qpu host name

property qpu_port

Returns the qpu port

run(qasm: str, reps: int)[source]

Runs the provided QASM circuit

property target

Returns the target name

class qstone.connectors.connector.ConnectorType(value)[source]

Bases: Enum

Type of connection

GRPC = 'GRPC'
HTTPS = 'HTTPS'
RIGETTI = 'RIGETTI'

Module contents