purplecaffeine.Trial

class Trial(name, uuid=None, storage=None, description=None, metrics=None, parameters=None, circuits=None, operators=None, artifacts=None, texts=None, arrays=None, tags=None, versions=None)[source]

Trial class.

description

short description of the trial

Type:

str

metrics

list of metric, like number of qubits

Type:

List[(str, Union[int, float])]

parameters

list of parameter, like env details

Type:

List[(str, str)]

circuits

list of quantum circuit

Type:

List[(str, QuantumCircuit)]

operators

list of operator, like Pauli operators

Type:

List[(str, Operator)]

artifacts

list of artifact, any external files

Type:

List[(str, Any)]

texts

list of text, any descriptions

Type:

List[(str, str)]

arrays

list of array, like quantum circuit results

Type:

List[(str, Union[np.ndarray, List[Any]])]

tags

list of tags in string format

Type:

List[str]

versions

list of qiskit version

Type:

List[(str, str)]

Trial class for tracking experiments data.

Parameters:
  • description (str) – short description of the trial

  • metrics (List[(str, Union[int, float])]) – list of metric, like number of qubits

  • parameters (List[(str, str)]) – list of parameter, like env details

  • circuits (List[(str, QuantumCircuit)]) – list of quantum circuit

  • operators (List[(str, Operator)]) – list of operator, like Pauli operators

  • artifacts (List[(str, Any)]) – list of artifact, any external files

  • texts (List[(str, str)]) – list of text, any descriptions

  • arrays (List[(str, Union[np.ndarray, List[Any]])]) – list of array, like quantum circuit results

  • tags (List[str]) – list of tags in string format

  • versions (List[(str, str)]) – list of qiskit version

__init__(name, uuid=None, storage=None, description=None, metrics=None, parameters=None, circuits=None, operators=None, artifacts=None, texts=None, arrays=None, tags=None, versions=None)[source]

Trial class for tracking experiments data.

Parameters:
  • description (str) – short description of the trial

  • metrics (List[(str, Union[int, float])]) – list of metric, like number of qubits

  • parameters (List[(str, str)]) – list of parameter, like env details

  • circuits (List[(str, QuantumCircuit)]) – list of quantum circuit

  • operators (List[(str, Operator)]) – list of operator, like Pauli operators

  • artifacts (List[(str, Any)]) – list of artifact, any external files

  • texts (List[(str, str)]) – list of text, any descriptions

  • arrays (List[(str, Union[np.ndarray, List[Any]])]) – list of array, like quantum circuit results

  • tags (List[str]) – list of tags in string format

  • versions (List[(str, str)]) – list of qiskit version

Methods

__init__(name[, uuid, storage, description, ...])

Trial class for tracking experiments data.

add_array(name, array)

Adds array to trial data.

add_artifact(name, artifact)

Adds artifacts path to trial data.

add_circuit(name, circuit)

Adds circuit to trial data.

add_description(description)

Add description to trial data.

add_metric(name, value)

Adds metric to trial data.

add_operator(name, operator)

Adds operator to trial data.

add_parameter(name, value)

Adds parameter to trial data.

add_tag(tag)

Adds any tag to trial data.

add_text(title, text)

Adds any text to trial data.

add_version(name, value)

Adds version to trial data.

export_to_shared_file(path)

Export trial to shared file.

import_from_shared_file(path, trial_id)

Import Trial for shared file.

read(trial_id)

Read a trial from Storage.

save()

Save into Storage.