quri_parts.qulacs.sampler module¶
- create_qulacs_vector_ideal_sampler(backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)¶
Create an ideal
Samplerusing 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
Samplerreturning 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
Samplerusing 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
Samplerthat 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
ConcurrentSamplerusing 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
ConcurrentSamplerthat samples concurrently.- Return type:
ConcurrentSampler
- create_qulacs_general_vector_sampler(random_seed=None, backend=<quri_parts.qulacs._backend.DefaultQulacsBackend object>)¶
Create a
GeneralSamplerusing 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
GeneralSamplercombining 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
GeneralSamplerusing Qulacs vector simulation.- Parameters:
backend (QulacsBackend) – Backend used to construct the qulacs state and read its state vector.
- Returns:
A
GeneralSamplerreturning 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
Samplerthat 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
Sampleraggregating 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
Samplerthat 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
Samplersampling 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
Samplerthat 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
Samplerreturning 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
GeneralSamplerthat 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
GeneralSamplercombining 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
GeneralSamplerthat 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
GeneralSamplerreturning 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
Samplerthat uses QulacsNoiseSimulator.- Parameters:
model (NoiseModel) – Noise model to apply.
random_seed (int | None) – Has no effect (
NoiseSimulatordoes not support seeding); a RuntimeWarning is emitted if notNone.backend (QulacsBackend) – Backend used to construct the qulacs state and the
NoiseSimulatorinstance.
- Returns:
A
Samplersampling via QulacsNoiseSimulator.- 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
ConcurrentSamplerthat 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
ConcurrentSamplersampling 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
ConcurrentSamplerthat 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
ConcurrentSampleraggregating 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
ConcurrentSamplerthat uses QulacsNoiseSimulator.- Parameters:
model (NoiseModel) – Noise model to apply.
random_seed (Optional[int]) – Has no effect (
NoiseSimulatordoes not support seeding); a RuntimeWarning is emitted if notNone.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
NoiseSimulatorinstance.
- Returns:
A
ConcurrentSamplersampling via QulacsNoiseSimulator.- 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
GeneralSamplerbased on QulacsNoiseSimulator.- Parameters:
model (NoiseModel) – Noise model to apply.
random_seed (Optional[int]) – Has no effect (
NoiseSimulatordoes not support seeding); a RuntimeWarning is emitted if notNone.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
NoiseSimulatorinstance.
- Returns:
A
GeneralSamplercombining a circuit sampler and a state sampler viaNoiseSimulator.- Return type:
GeneralSampler[QulacsStateT, QulacsParametricStateT]