def test_pmps_reduction_array_slow_prune(
nr_sites, local_dim, rank, keep, rgen, benchmark):
pmps = factory.random_mpa(nr_sites, (local_dim, local_dim), rank,
dtype=np.complex_, normalized=True,
randstate=rgen)
benchmark(
lambda: mp.prune(mm.pmps_to_mpo(mm.pmps_reduction(pmps, keep)),
singletons=True).to_array()
)
评论列表
文章目录