qat.qlmaas.generators.QLMaaSGenerator

Remote Generators are managed by QLMaaSGenerator objects. These objects can be built using:

class qat.qlmaas.generators.QLMaaSGenerator(connection, name: str, constructor: SerializedArguments, description: str)

Class decribing a BatchGenerator defined on a remote server.

If a configuration is present on your computer, you can use the module qlmaas.generators to instantiate a remote BatchGenerator

from qlmaas.generators import MaxCutGenerator

# Define a generator
max_cut = MaxCutGenerator()

Otherwise, if no configuration file is set on your machine, you can use a QLMaaSConnection object:

from qat.qlmaas import QLMaaSConnection

# Connect to the server
conn = QLMaaSConnection()

# Get remote BatchGenerator
MaxCutGenerator = conn.get_generator("qat.generators:MaxCutGenerator")
max_cut = MaxCutGenerator()
generate(specs, *args, mem_usage: Optional[int] = None, core_usage: Optional[int] = None, nb_nodes: Optional[int] = None, **kwargs)

Generate a batch. This batch will be generated on the server using an asynchronous mode.

Parameters
  • specs (HardwareSpecs) – hardware specs

  • mem_usage (int, optional) – override the memory usage (in MB)

  • core_usage (int, optional) – override the core usage

  • *args – additional arguments to generate a Batch

  • **kwargs – addtional keyword arguments to generate a Batch

Returns

asynchronous result

Return type

AsyncResult