quri_parts.qulacs.sampler module

create_qulacs_vector_ideal_sampler(backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create an ideal Sampler using Qulacs vector simulation.

The returned sampler produces counts proportional to the exact probabilities (no shot noise).

Parameters:

backend (QulacsBackend) – Backend used to construct the qulacs state and read its state vector.

Returns:

A Sampler returning ideal (probability-weighted) counts.

Return type:

core.sampling.Sampler

create_qulacs_vector_sampler(random_seed=None, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a Sampler using Qulacs vector simulation.

Parameters:
  • random_seed (int | None) – Optional random seed for sampling.

  • backend (QulacsBackend) – Backend used for simulation (state construction and sampling strategy).

Returns:

A Sampler that samples measurement outcomes.

Return type:

core.sampling.Sampler

create_qulacs_vector_concurrent_sampler(random_seed=None, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a ConcurrentSampler using Qulacs vector simulation.

Parameters:
  • random_seed (Optional[int]) – Optional random seed for sampling.

  • executor (Optional['Executor']) – Executor used to run samplers concurrently.

  • concurrency (int) – Maximum number of concurrent sampler invocations.

  • backend (QulacsBackend) – Backend used for simulation (state construction and sampling strategy).

Returns:

A ConcurrentSampler that samples concurrently.

Return type:

ConcurrentSampler

create_qulacs_general_vector_sampler(random_seed=None, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a GeneralSampler using Qulacs vector simulation.

Parameters:
  • random_seed (int | None) – Optional random seed for sampling.

  • backend (QulacsBackend) – Backend used for simulation (state construction and sampling strategy).

Returns:

A GeneralSampler combining a circuit sampler and a state sampler.

Return type:

GeneralSampler[qulacs.types.QulacsStateT, qulacs.types.QulacsParametricStateT]

create_qulacs_general_vector_ideal_sampler(backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create an ideal GeneralSampler using Qulacs vector simulation.

Parameters:

backend (QulacsBackend) – Backend used to construct the qulacs state and read its state vector.

Returns:

A GeneralSampler returning ideal (probability-weighted) counts.

Return type:

GeneralSampler[qulacs.types.QulacsStateT, qulacs.types.QulacsParametricStateT]

create_qulacs_stochastic_state_vector_sampler(model, random_seed=None, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a Sampler that repeats stochastic noisy state vector simulation once per shot.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (int | None) – Optional random seed for sampling.

  • backend (QulacsBackend) – Backend used to construct the qulacs state.

Returns:

A Sampler aggregating one-shot samples from independent noisy trajectories.

Return type:

core.sampling.Sampler

create_qulacs_density_matrix_sampler(model, random_seed=None, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a Sampler that samples from a noisy density matrix.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (int | None) – Optional random seed for sampling.

  • backend (QulacsBackend) – Backend used to construct the qulacs density matrix.

Returns:

A Sampler sampling from the noisy density matrix.

Return type:

core.sampling.Sampler

create_qulacs_density_matrix_ideal_sampler(model, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create an ideal Sampler that returns counts proportional to the exact probabilities derived from a noisy density matrix.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • backend (QulacsBackend) – Backend used to construct the qulacs density matrix.

Returns:

A Sampler returning ideal (probability-weighted) counts.

Return type:

core.sampling.Sampler

create_qulacs_density_matrix_general_sampler(model, random_seed=None, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a GeneralSampler that samples from a noisy density matrix.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (Optional[int]) – Optional random seed for sampling.

  • executor (Optional['Executor']) – Currently has no effect; reserved for future use.

  • concurrency (int) – Currently has no effect; reserved for future use.

  • backend (QulacsBackend) – Backend used to construct the qulacs density matrix.

Returns:

A GeneralSampler combining a circuit sampler and a state sampler.

Return type:

GeneralSampler[QulacsStateT, QulacsParametricStateT]

create_qulacs_ideal_density_matrix_general_sampler(model, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create an ideal GeneralSampler that returns counts proportional to the exact probabilities of a noisy density matrix.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • executor (Optional['Executor']) – Currently has no effect; reserved for future use.

  • concurrency (int) – Currently has no effect; reserved for future use.

  • backend (QulacsBackend) – Backend used to construct the qulacs density matrix.

Returns:

A GeneralSampler returning ideal (probability-weighted) counts.

Return type:

GeneralSampler[QulacsStateT, QulacsParametricStateT]

create_qulacs_noisesimulator_sampler(model, random_seed=None, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a Sampler that uses Qulacs NoiseSimulator.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (int | None) – Has no effect (NoiseSimulator does not support seeding); a RuntimeWarning is emitted if not None.

  • backend (QulacsBackend) – Backend used to construct the qulacs state and the NoiseSimulator instance.

Returns:

A Sampler sampling via Qulacs NoiseSimulator.

Return type:

core.sampling.Sampler

create_qulacs_density_matrix_concurrent_sampler(model, random_seed=None, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a ConcurrentSampler that samples from a noisy density matrix concurrently.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (Optional[int]) – Optional random seed for sampling.

  • executor (Optional['Executor']) – Executor used to run samplers concurrently.

  • concurrency (int) – Maximum number of concurrent sampler invocations.

  • backend (QulacsBackend) – Backend used to construct the qulacs density matrix.

Returns:

A ConcurrentSampler sampling from the noisy density matrix.

Return type:

ConcurrentSampler

create_qulacs_stochastic_state_vector_concurrent_sampler(model, random_seed=None, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a ConcurrentSampler that repeats stochastic noisy state vector simulation concurrently.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (Optional[int]) – Optional random seed for sampling.

  • executor (Optional['Executor']) – Executor used to run samplers concurrently.

  • concurrency (int) – Maximum number of concurrent sampler invocations.

  • backend (QulacsBackend) – Backend used to construct the qulacs state.

Returns:

A ConcurrentSampler aggregating samples from independent noisy trajectories.

Return type:

ConcurrentSampler

create_qulacs_noisesimulator_concurrent_sampler(model, random_seed=None, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a ConcurrentSampler that uses Qulacs NoiseSimulator.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (Optional[int]) – Has no effect (NoiseSimulator does not support seeding); a RuntimeWarning is emitted if not None.

  • executor (Optional['Executor']) – Executor used to run samplers concurrently.

  • concurrency (int) – Maximum number of concurrent sampler invocations.

  • backend (QulacsBackend) – Backend used to construct the qulacs state and the NoiseSimulator instance.

Returns:

A ConcurrentSampler sampling via Qulacs NoiseSimulator.

Return type:

ConcurrentSampler

create_qulacs_noisesimulator_general_sampler(model, random_seed=None, executor=None, concurrency=1, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)

Create a GeneralSampler based on Qulacs NoiseSimulator.

Parameters:
  • model (NoiseModel) – Noise model to apply.

  • random_seed (Optional[int]) – Has no effect (NoiseSimulator does not support seeding); a RuntimeWarning is emitted if not None.

  • executor (Optional['Executor']) – Currently has no effect; reserved for future use.

  • concurrency (int) – Currently has no effect; reserved for future use.

  • backend (QulacsBackend) – Backend used to construct the qulacs state and the NoiseSimulator instance.

Returns:

A GeneralSampler combining a circuit sampler and a state sampler via NoiseSimulator.

Return type:

GeneralSampler[QulacsStateT, QulacsParametricStateT]