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, host: str, server_port: int, 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, host: str, server_port: int, 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 connection

Returns the server_port

property host

Returns the host name

property lockfile

Returns the lockfile information

property protocol

Returns the protocol information

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

Runs the provided QASM circuit

property server_port

Returns the server_port

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

Bases: Enum

Type of connection

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

Module contents