Skip to content

Commit

Permalink
Replaced np.Inf with np.inf
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjosegarciaripoll committed Jun 28, 2024
1 parent 8f195e4 commit fc8e635
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/seemps/analysis/evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def euler(
"""
normalization_strategy = strategy.replace(normalize=True)
state = CanonicalMPS(state, normalize=True)
results = EvolutionResults(state=state, energy=np.Inf, trajectory=[], Δβ=Δβ, β=[0])
results = EvolutionResults(state=state, energy=np.inf, trajectory=[], Δβ=Δβ, β=[0])
for i in range(maxiter + 1):
if i > 0:
H_state = H.apply(state)
Expand Down Expand Up @@ -95,7 +95,7 @@ def improved_euler(
"""
normalization_strategy = strategy.replace(normalize=True)
state = CanonicalMPS(state, normalize=True)
results = EvolutionResults(state=state, energy=np.Inf, trajectory=[], Δβ=Δβ, β=[0])
results = EvolutionResults(state=state, energy=np.inf, trajectory=[], Δβ=Δβ, β=[0])
for i in range(maxiter):
if i > 0:
H_state = H.apply(state)
Expand Down Expand Up @@ -125,7 +125,7 @@ def runge_kutta(
"""
normalization_strategy = strategy.replace(normalize=True)
state = CanonicalMPS(state, normalize=True)
results = EvolutionResults(state=state, energy=np.Inf, trajectory=[], Δβ=Δβ, β=[0])
results = EvolutionResults(state=state, energy=np.inf, trajectory=[], Δβ=Δβ, β=[0])
for i in range(maxiter):
if i > 0:
H_state = H.apply(state)
Expand Down
4 changes: 2 additions & 2 deletions src/seemps/optimization/descent.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ def gradient_descent(
state = simplify(guess, strategy=strategy)
results = OptimizeResults(
state=state,
energy=np.Inf,
energy=np.inf,
converged=False,
message=f"Exceeded maximum number of steps {maxiter}",
)
E = last_E = variance = avg_H2 = np.Inf
E = last_E = variance = avg_H2 = np.inf
H_state: MPS
with make_logger() as logger:
logger(f"gradient_descent() invoked with {maxiter} iterations")
Expand Down
2 changes: 1 addition & 1 deletion src/seemps/optimization/dmrg.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def dmrg(
logger(f"start, energy={energy}, variance={variance}")
if callback is not None:
callback(QF.state, results)
E: float = np.Inf
E: float = np.inf
last_E: float = E
strategy = strategy.replace(normalize=True)
for step in range(maxiter):
Expand Down
4 changes: 2 additions & 2 deletions src/seemps/optimization/power.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def power_method(
)
results = PowerMethodOptimizeResults(
state=state,
energy=np.Inf,
energy=np.inf,
converged=False,
trajectory=[],
variances=[],
Expand All @@ -82,7 +82,7 @@ def power_method(
# This extra field is needed because CGS consumes iterations
# in itself.
results.steps = []
last_energy = np.Inf
last_energy = np.inf
logger = make_logger()
logger(f"power_method() invoked with {maxiter} iterations")
total_steps = 0
Expand Down

0 comments on commit fc8e635

Please sign in to comment.