wavesqurry

WavesExecuter (qurry.qurrium.wavesqurry)

It is only for pendings and retrieve to remote backend.

arguments

WavesExecuter - Arguments (qurry.qurrium.wavesqurry.arguments)

It is only for pendings and retrieve to remote backend.

qurry.qurries.wavesqurry.arguments.SHORT_NAME = 'waves_executer'

The short name for this qurry instance.

class qurry.qurries.wavesqurry.arguments.WavesExecuterAnalyzeArgs[source]

The input of the analyze method.

class qurry.qurries.wavesqurry.arguments.WavesExecuterArguments(exp_name: str)[source]

Construct the experiment’s parameters for specific options, which is overwritable by the inherition class.

class qurry.qurries.wavesqurry.arguments.WavesExecuterMeasureArgs[source]

Output arguments for output().

class qurry.qurries.wavesqurry.arguments.WavesExecuterOutputArgs[source]

Output arguments for output().

analysis

WavesExecuter - Analysis (qurry.qurrium.wavesqurry.analysis)

It is only for pendings and retrieve to remote backend.

class qurry.qurries.wavesqurry.analysis.WEAnalysisContent(ultimate_answer: int, dummy: int)[source]

Analysis content.

dummy: int

Just a dummy field.

ultimate_answer: int

~The Answer to the Ultimate Question of Life, The Universe, and Everything.~

class qurry.qurries.wavesqurry.analysis.WEAnalysisInput(ultimate_question: str)[source]

To set the analysis.

ultimate_question: str

ULtImAte QueStIoN.

class qurry.qurries.wavesqurry.analysis.WavesExecuterAnalysis(*, serial: int, log: dict[str, Any] | None = None, datatime: str | None = None, **other_kwargs)[source]

The analysis of the experiment.

classmethod content_type()[source]

The content instance type.

classmethod input_type()[source]

The input instance type.

property side_product_fields: Iterable[str]

The fields that will be stored as side product.

experiment

WavesExecuter - Experiment (qurry.qurrium.wavesqurry.experiment)

It is only for pendings and retrieve to remote backend.

class qurry.qurries.wavesqurry.experiment.WavesExecuterExperiment(arguments: _A | dict[str, Any], commonparams: Commonparams | dict[str, Any], outfields: dict[str, Any], beforewards: Before | None = None, afterwards: After | None = None, reports: AnalysesContainer | None = None)[source]

The instance of experiment.

property analysis_instance: Type[WavesExecuterAnalysis]

The analysis instance for this experiment.

analyze(ultimate_question: str = '', shots: int | None = None, pbar: tqdm | None = None) WavesExecuterAnalysis[source]

Analysis of the experiment.

Parameters:
  • ultimate_question (str, optional) – The ultimate question of the universe. Defaults to ‘’.

  • shots (Optional[int], optional) – The number of shots. Defaults to None.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar. Defaults to None.

Returns:

The analysis of the experiment

Return type:

WavesExecuterAnalysis

property arguments_instance: Type[WavesExecuterArguments]

The arguments instance for this experiment.

classmethod method(targets: list[tuple[Hashable, QuantumCircuit]], arguments: WavesExecuterArguments, pbar: tqdm | None = None, multiprocess: bool = True) tuple[list[QuantumCircuit], dict[str, Any]][source]

The method to construct circuit.

Parameters:
  • targets (list[tuple[Hashable, QuantumCircuit]]) – The circuits of the experiment.

  • arugments (ArgumentsPrototype) – The arguments of the experiment.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar for showing the progress of the experiment. Defaults to None.

  • multiprocess (bool, optional) – Whether to use multiprocessing. Defaults to True.

Returns:

The circuits of the experiment and the side products.

Return type:

tuple[list[QuantumCircuit], dict[str, Any]]

classmethod params_control(targets: list[tuple[Hashable, QuantumCircuit]], exp_name: str = 'exps', **custom_kwargs: Any) tuple[WavesExecuterArguments, Commonparams, dict[str, Any]][source]

Control the experiment’s parameters.

Parameters:
  • targets (list[tuple[Hashable, QuantumCircuit]]) – The circuits of the experiment.

  • exp_name (str, optional) – The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘experiment’.

  • custom_kwargs (Any) – The custom parameters.

Returns:

The arguments of the experiment, the common parameters, and the custom parameters.

Return type:

tuple[WavesExecuterArguments, Commonparams, dict[str, Any]]

classmethod quantities(shots: int | None = None, counts: list[dict[str, int]] | None = None, ultimate_question: str = '') dict[str, float | int][source]

Computing specific squantity. Where should be overwritten by each construction of new measurement.

Returns:

Counts, purity, entropy of experiment.

Return type:

dict[str, float]

qurry

WavesExecuter (qurry.qurrium.wavesqurry)

It is only for pendings and retrieve to remote backend.

class qurry.qurries.wavesqurry.qurry.WavesExecuter[source]

The pending and retrieve executer for waves.

property experiment_instance: Type[WavesExecuterExperiment]

The container class responding to this Qurrium class.

measure(waves: list[QuantumCircuit | Hashable] | None = None, shots: int = 1024, backend: Backend | None = None, exp_name: str = 'experiment', run_args: BaseRunArgs | dict[str, Any] | None = None, transpile_args: TranspileArgs | None = None, passmanager: str | PassManager | tuple[str, PassManager] | None = None, tags: tuple[str, ...] | None = None, qasm_version: Literal['qasm2', 'qasm3'] = 'qasm3', export: bool = False, save_location: Path | str | None = None, pbar: tqdm | None = None)[source]

Execute the experiment.

Parameters:
  • waves (list[Union[QuantumCircuit, Hashable]]) – The key or the circuit to execute.

  • shots (int, optional) – Shots of the job. Defaults to 1024.

  • backend (Optional[Backend], optional) – The quantum backend. Defaults to None.

  • exp_name (str, optional) – The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘experiment’.

  • run_args (RunArgsType, optional) – Arguments for Backend.run(). Defaults to None.

  • transpile_args (Optional[TranspileArgs], optional) – Arguments of transpile() from qiskit.compiler.transpiler. Defaults to None.

  • passmanager (Optional[Union[str, PassManager, tuple[str, PassManager]], optional) – The passmanager. Defaults to None.

  • tags (Optional[tuple[str, ...]], optional) – The tags of the experiment. Defaults to None.

  • qasm_version (Literal["qasm2", "qasm3"], optional) – The version of OpenQASM. Defaults to “qasm3”.

  • export (bool, optional) – Whether to export the experiment. Defaults to False.

  • save_location (Optional[Union[Path, str]], optional) – The location to save the experiment. Defaults to None.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar for showing the progress of the experiment. Defaults to None.

Returns:

The experiment ID.

Return type:

str

measure_to_output(waves: list[QuantumCircuit | Hashable] | None = None, shots: int = 1024, backend: Backend | None = None, exp_name: str = 'experiment', run_args: BaseRunArgs | dict[str, Any] | None = None, transpile_args: TranspileArgs | None = None, passmanager: str | PassManager | tuple[str, PassManager] | None = None, tags: tuple[str, ...] | None = None, qasm_version: Literal['qasm2', 'qasm3'] = 'qasm3', export: bool = False, save_location: Path | str | None = None, pbar: tqdm | None = None) WavesExecuterOutputArgs[source]

Trasnform measure() arguments form into output() form.

Parameters:
  • waves (list[Union[QuantumCircuit, Hashable]]) – The key or the circuit to execute.

  • shots (int, optional) – Shots of the job. Defaults to 1024.

  • backend (Optional[Backend], optional) – The quantum backend. Defaults to None.

  • exp_name (str, optional) – The name of the experiment. Naming this experiment to recognize it when the jobs are pending to IBMQ Service. This name is also used for creating a folder to store the exports. Defaults to ‘experiment’.

  • run_args (RunArgsType, optional) – Arguments for Backend.run(). Defaults to None.

  • transpile_args (Optional[TranspileArgs], optional) – Arguments of transpile() from qiskit.compiler.transpiler. Defaults to None.

  • passmanager (Optional[Union[str, PassManager, tuple[str, PassManager]], optional) – The passmanager. Defaults to None.

  • tags (Optional[tuple[str, ...]], optional) – The tags of the experiment. Defaults to None.

  • qasm_version (Literal["qasm2", "qasm3"], optional) – The version of OpenQASM. Defaults to “qasm3”.

  • export (bool, optional) – Whether to export the experiment. Defaults to False.

  • save_location (Optional[Union[Path, str]], optional) – The location to save the experiment. Defaults to None.

  • pbar (Optional[tqdm.tqdm], optional) – The progress bar for showing the progress of the experiment. Defaults to None.

Returns:

The output arguments.

Return type:

WavesExecuterOutputArgs

short_name = 'waves_executer'

The short name of Qurrium.