Quantum Manager Client

This module defines the QuantumManagerClient class.

This client provides the same interface as the QuantumManager class for manipulating qubits. Qubits only managed by the local process are stored within a QuantumManager class instance. Qubits managed or accessed between processes are stored on a remote quantum manager server.

class parallel.src.quantum_manager_client.QuantumManagerClient(formalism: str, ip: str, port: int)

Class to process interactions with remote quantum manager server.

Unless otherwise noted, the operation of all functions are the same as those of the QuantumManagerClass.

formalism

formalism to use for quantum manager (must match server).

Type:

str

ip

ip address of quantum manager server.

Type:

str

port

port of quantum manager server.

Type:

int

socket

socket for communication with server.

Type:

socket

managed_qubits

keys for all qubits managed locally by client.

Type:

set

message_buffer

list of messages to send to quantum manager server.

Type:

List

disconnect_from_server()

Closes socket connection with quantum manager server.

Uses a message of type QuantumManagerServer.CLOSE.

Side Effects:

closes socket attribute connection.

kill() None

Method to terminate the connected server.

Uses a message of type QuantumManagerMsgType.TERMINATE.

Side Effects:

Will end all processes on the remote server.

move_manage_to_server(qubit_key: int, sync_state=True)

Move management of a qubit from the local quantum manager to quantum manager server.

Parameters:
  • qubit_key (int) – qubit key to move.

  • sync_state (bool) – indicates if server state should be set to match local (default True).

new(state=(1 + 0j, 0j)) int

Method to get a new state from server.

Parameters:

state (List) – if None, state will be in default state. Otherwise, must match formalism of server.

Returns:

key for the new state generated.

Return type:

int