Skip to content

Commit

Permalink
Bump black from 23.12.1 to 24.3.0 (#248)
Browse files Browse the repository at this point in the history
* Bump black from 23.12.1 to 24.3.0

Bumps [black](https://github.com/psf/black) from 23.12.1 to 24.3.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](psf/black@23.12.1...24.3.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and pre-commit-ci[bot] authored Apr 23, 2024
1 parent 80999db commit 98de7c7
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 33 deletions.
4 changes: 3 additions & 1 deletion examples/decoding/classical.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@
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.")
parser.add_argument(
"bond_dim", type=int, help="Maximum bond dimension to keep during contraction."
)
args = parser.parse_args()

NUM_BITS = args.system_size
Expand Down
4 changes: 1 addition & 3 deletions mdopt/mps/explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,7 @@ def entanglement_entropy(self) -> np.ndarray:
singular_values = self.singular_values[bond].copy()
singular_values = np.array(singular_values) # type: ignore
singular_values[singular_values < self.tolerance] = 0 # type: ignore
singular_values2 = [
singular_value**2 for singular_value in singular_values
]
singular_values2 = [singular_value**2 for singular_value in singular_values]
entropy[bond] = -1 * np.sum(
np.fromiter((xlogy(s, s) for s in singular_values2), dtype=float)
)
Expand Down
50 changes: 25 additions & 25 deletions poetry.lock

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

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ matrex = "^0.0.1"
optional = true

[tool.poetry.group.dev.dependencies]
black = ">=22.3,<24.0"
black = ">=22.3,<25.0"
pylint = ">=2.17.4,<4.0.0"
setuptools = ">=67.8,<70.0"
mypy = "^1.3"
Expand Down
4 changes: 1 addition & 3 deletions tests/mps/test_explicit.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ def test_explicit_density_mpo():

density_matrix_mpo = density_matrix_mpo.transpose(correct_order)
# Reshaping to the matrix form.
density_matrix_mpo = density_matrix_mpo.reshape(
(2**num_sites, 2**num_sites)
)
density_matrix_mpo = density_matrix_mpo.reshape((2**num_sites, 2**num_sites))

# Original density matrix.
density_matrix = np.tensordot(psi, np.conjugate(psi), 0)
Expand Down

0 comments on commit 98de7c7

Please sign in to comment.