Skip to content

Commit

Permalink
context one dot
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Jun 24, 2024
1 parent 6ae27a9 commit d5bec5c
Show file tree
Hide file tree
Showing 4 changed files with 363 additions and 118 deletions.
13 changes: 10 additions & 3 deletions pyblock2/driver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,7 @@ def __init__(
fp_codec_cutoff=1e-16,
fp_codec_chunk=1024,
min_mpo_mem=False,
seq_type=None,
compressed_mps_storage=False,
):
"""
Expand Down Expand Up @@ -608,6 +609,8 @@ def __init__(
Chunk size for compressed storage of renormalized operators. Default is 1024.
min_mpo_mem : bool
If True, will dynamically load/save MPO to save memory. Default is False.
seq_type : None or str
Shared-memory scheme type. Default is None ('Tasked').
compressed_mps_storage : bool
Whether block-sparse tensor should be stored in compressed form to save storage (mainly for MPS).
Default is False.
Expand Down Expand Up @@ -638,7 +641,11 @@ def __init__(
n_threads // n_mkl_threads,
n_mkl_threads,
)
bw.b.Global.threading.seq_type = bw.b.SeqTypes.Tasked
if seq_type is None:
seq_type = bw.b.SeqTypes.Tasked
else:
seq_type = getattr(bw.b.SeqTypes, seq_type)
bw.b.Global.threading.seq_type = seq_type
self.reorder_idx = None
self.pg = "c1"
self.orb_sym = None
Expand Down Expand Up @@ -7146,8 +7153,8 @@ def get_spin_projection_mpo(
it = np.ones((1, 1, 1, 1))
pympo = None
for ixw, (xt, wt) in enumerate(zip(xts, wts)):
if not mpi_split or (
mpi_split
if self.mpi is None or not mpi_split or (
mpi_split
and self.mpi.rank == min(ixw, len(wts) - 1 - ixw) % self.mpi.size
):
ct = np.cos(xt / 2) * it
Expand Down
Loading

0 comments on commit d5bec5c

Please sign in to comment.