Skip to content

Commit

Permalink
Merge branch 'main' of github.com:quicophy/mdopt
Browse files Browse the repository at this point in the history
  • Loading branch information
meandmytram committed Apr 24, 2024
2 parents 97cac24 + 174db73 commit 856e73f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
8 changes: 5 additions & 3 deletions examples/decoding/classical.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@
parser = argparse.ArgumentParser(
description="Launch calculations on Compute Canada clusters."
)
parser.add_argument("system_size", type=int, help="System size as the number of bits.")
parser.add_argument(
"bond_dim", type=int, help="Maximum bond dimension to keep during contraction."
"--system_size", type=int, help="System size as the number of bits."
)
parser.add_argument(
"--bond_dim", type=int, help="Maximum bond dimension to keep during contraction."
)
args = parser.parse_args()

Expand Down Expand Up @@ -125,7 +127,7 @@
chi_max=CHI_MAX_CONTRACTOR,
renormalise=True,
result_to_explicit=False,
strategy="Naive",
strategy="Optimized",
silent=True,
)
logging.info("Decoding the perturbed codeword state using DMRG.")
Expand Down
3 changes: 3 additions & 0 deletions examples/decoding/decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,8 @@ def apply_constraints(
entropies = []
bond_dims = []

# Using matrix front minimization technique to optimize the order
# in which to apply the checks.
if strategy == "Optimized":
mpo_location_matrix = np.zeros((len(strings), mps.num_sites))
for row_idx, sublist in enumerate(strings):
Expand All @@ -724,6 +726,7 @@ def apply_constraints(
optimized_order = msro(mpo_location_matrix)
strings = [strings[index] for index in optimized_order]

# Do not optimize the order in which to apply the checks.
if strategy == "Naive":
pass

Expand Down
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 856e73f

Please sign in to comment.