Skip to content

Commit

Permalink
core: option for not adding ident in mpo
Browse files Browse the repository at this point in the history
  • Loading branch information
hczhai committed Mar 3, 2023
1 parent 96b23aa commit 70f9d7d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyblock2/driver/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ def get_qc_mpo(
disjoint_all_blocks=False,
disjoint_multiplier=1.0,
block_max_length=False,
add_ident=True,
iprint=1,
):
import numpy as np
Expand Down Expand Up @@ -1118,6 +1119,7 @@ def get_qc_mpo(
disjoint_all_blocks=disjoint_all_blocks,
disjoint_multiplier=disjoint_multiplier,
block_max_length=block_max_length,
add_ident=add_ident,
)

def get_mpo(
Expand All @@ -1136,6 +1138,7 @@ def get_mpo(
disjoint_all_blocks=False,
disjoint_multiplier=1.0,
block_max_length=False,
add_ident=True,
):
bw = self.bw
import time
Expand Down Expand Up @@ -1181,7 +1184,8 @@ def get_mpo(
self.mpi.barrier()

mpo = bw.bs.SimplifiedMPO(mpo, bw.bs.Rule(), False, False)
mpo = bw.bs.IdentityAddedMPO(mpo)
if add_ident:
mpo = bw.bs.IdentityAddedMPO(mpo)
if self.mpi:
mpo = bw.bs.ParallelMPO(mpo, self.prule)
return mpo
Expand Down

0 comments on commit 70f9d7d

Please sign in to comment.