API Documentation#

API quantuloop_aws_client#

Quantuloop Quantum Simulator AWS Client API documentation.

import quantuloop_aws_client
quantuloop_aws_client.setup_server(url, private_key, passphrase=None)#

Configure simulation server.

Example

import quantuloop_aws_client as ql

server = ql.setup_server(
    url="http://127.0.0.1:8000",
    private_key="~/.ssh/id_rsa",
    passphrase=True,
)

from ket import Process

process = Process(server(
    num_qubits=182,
    simulator="quantuloop::sparse"
))

See quantuloop_aws_client.make_configuration() for more details.

Note

The quantum execution is configured in batch mode.

Parameters:
  • url (str) – Server URL, for example, https://example.com or http://127.0.0.1:8080.

  • private_key (PathLike) – Path for the OpenSSH RSA private key.

  • passphrase (Union[bool, bytes, None]) – Password to decrypt the private key. Set to True to prompt for the password, or pass the password in plain text in bytes. Set to None if the key is not encrypted. Default: None.

Return type:

Callable

Returns:

A callable to configure Ket precesses.

quantuloop_aws_client.make_configuration(num_qubits, simulator, gpu_count=0, precision=1, seed=None, *, server_config)#

Generate configuration for Ket process.

This functions is not intended to be called directly. Instead, quantuloop_aws_client.setup_server() should be used to configure the quantum execution.

Example

import quantuloop_aws_client as ql

server = ql.setup_server( # this is a partial call for make_configuration.
    url="http://127.0.0.1:8000",
    private_key="~/.ssh/id_rsa",
    passphrase=True,
)

from ket import Process

process = Process(server(
    num_qubits=182,
    simulator="quantuloop::sparse"
))
Parameters:
  • num_qubits (int) – Number of qubits in the simulations.

  • simulator (Literal['kbw::dense', 'kbw::sparse', 'quantuloop::dense', 'quantuloop::sparse']) – Simulator identifier.

  • gpu_count (int) – Maximum number of GPUs; if set to 0, simulation will use all available GPUs. Defaults to 0.

  • precision (Literal[1, 2]) – floating point precision used in the simulation; positive values are: 1 for single precision (float) and 2 for double precision. Defaults to 1.

  • seed (Optional[int]) – Seed for the quantum execution RNG. Defaults to None.

  • server_config – Generated from quantuloop_aws_client.setup_server().

Returns:

Configuration for Ket process.

API quantuloop_simulator#

Quantuloop Quantum Simulator API documentation.

import quantuloop_simulator
quantuloop_simulator.set_token(token=None, token_file=None)#

Set Quantuloop Access Token.

This token is used to authenticate access to the simulator.

Parameters:
  • token (Optional[str]) – A Quantuloop Access Token. This token is used to authenticate access to the simulator. If you do not provide a token, the simulator will not work.

  • token_file (Optional[PathLike]) – A file containing the Quantuloop Access Token. The file must contain a single line with the access token. If you specify both a token and a token file, the function will raise a ValueError.

quantuloop_simulator.get_simulator(num_qubits, execution='live', simulator=None, *, gpu_count=None, precision=None)#

Get a Quantuloop simulator configuration.

Parameters:
  • num_qubits (int) – Number of qubits in simulation.

  • execution (Literal['live', 'batch']) – Quantum execution mode.

  • gpu_count (Optional[int]) – An integer that determine the maximum number of GPUs used in the execution. If set to 0, the simulator will use all available GPUs.

  • precision (Optional[Literal[1, 2]]) – A integer the specifies the floating point precision used in the simulation. Positive values are 1 for single precision (float) and 2 for double precision.