quri_parts.itensor.sampler module#
- create_itensor_mps_sampler(*, maxdim=None, cutoff=None, **kwargs)#
Returns a
Sampler
that uses ITensor mps simulator for sampling.The following parameters including keyword arguments **kwargs are passed to ITensors.apply
- Parameters:
maxdim (int | None) – The maximum number of singular values.
cutoff (float | None) – Singular value truncation cutoff.
kwargs (Any) –
- Return type:
core.sampling.Sampler
- create_itensor_mps_concurrent_sampler(executor=None, concurrency=1, *, maxdim=None, cutoff=None, **kwargs)#
Returns a
ConcurrentSampler
that uses ITensor mps simulator for sampling.The following parameters including keyword arguments **kwargs are passed to ITensors.apply
- Parameters:
maxdim (Optional[int]) – The maximum number of singular values.
cutoff (Optional[float]) – Singular value truncation cutoff.
executor (Optional['Executor']) –
concurrency (int) –
kwargs (Any) –
- Return type:
ConcurrentSampler
For now, this function works when the executor is defined like below
Examples
>>> with ProcessPoolExecutor( max_workers=2, mp_context=get_context("spawn") ) as executor: sampler = create_itensor_mps_concurrent_sampler( executor, 2, **kwargs ) results = list(sampler([(circuit1, 1000), (circuit2, 2000)]))