QCalibrate remote interface
Project description
A client library for runnig a custom optimisation with qcalibrate software
Description
Example simple parameter parametrisation
# import dependencies
from typing import Dict
from qcalibrateremote import (
EvaluateFigureOfMerit,
FigureOfMerit,
create_optimizer_client,
)
# setup client connection (copy form web UI: https://www.qcalibrate.staging.optimal-control.net:31603)
experiment_id="0xabcd"
token=("ey...")
optimizer_client = create_optimizer_client(
host="grpc.qcalibrate.staging.optimal-control.net", port=31603, token=token)
# define infidelity evaluation class
class DistanceFom(EvaluateFigureOfMerit):
def __init__(self, *args, **kwargs) -> None:
super().__init__()
def infidelity(self, param1, param2) -> float:
return (param1 - 0.55)**2 + (param2 - 0.33)**2
def evaluate(self, parameters: Dict[str, float], **kwargs) -> FigureOfMerit:
"""Abstract method for figure of merit evaluation"""
# print(parameters)
return FigureOfMerit(self.infidelity(**parameters), '')
# run optimisation
optimisation_result = optimizer_client.run(experiment_id=experiment_id, evaluate_fom_class=DistanceFom)
# best fiting parameters
optimisation_result.top[0].parameters
Note
The API is experimental and subject to change without a prior notice
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
qcalibrateremote-0.1.3.tar.gz
(34.6 kB
view hashes)
Built Distribution
Close
Hashes for qcalibrateremote-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37402e8fe0cc0e16328eded7e566f35ad8dac7e96a9d8a9fa34431e1c3aed10c |
|
MD5 | 2b8f44704942b330a5e4442fe1a6b19d |
|
BLAKE2b-256 | f6522e9c79a70392c07ddd816aa12a1452aee5e66506ac8b6ea5281485d91c24 |