constructΒΆ

Construct (qurry.qurrium.utils.construct)

qurry.qurrium.utils.construct.decomposer(qc: QuantumCircuit, reps: int = 2) QuantumCircuit[source]ΒΆ

Decompose the circuit with giving times.

Parameters:
  • qc (QuantumCircuit) – The circuit wanted to be decomposed.

  • reps (int, optional) – Decide the times of decomposing the circuit. Draw quantum circuit with composed circuit. Defaults to 2.

Returns:

The decomposed circuit.

Return type:

QuantumCircuit

qurry.qurrium.utils.construct.get_counts_and_exceptions(result: Result | None, num: int | None = None, result_idx_list: list[int] | None = None) tuple[list[dict[str, int]], dict[str, Exception]][source]ΒΆ

Get counts and exceptions from result.

Parameters:
  • result (Optional[Result]) – The result of job.

  • num (Optional[int], optional) – The number of counts wanted to be extracted. Defaults to None.

  • result_idx_list (Optional[list[int]], optional) – The index of counts wanted to be extracted. Defaults to None.

Returns:

Counts and exceptions.

Return type:

tuple[list[dict[str, int]], dict[str, Exception]]