Skip to content

Commit

Permalink
format with black
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipVinc committed Oct 31, 2023
1 parent 749f2b5 commit 99f2f35
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

@partial(jax.vmap, in_axes=(0, None, None, None), out_axes=(0))
def spwf(sigma, orbital_up, orbital_down, N):

return 0.5 * (1 + sigma) * orbital_up + 0.5 * (1 - sigma) * orbital_down


Expand Down
8 changes: 3 additions & 5 deletions examples/state_learning/state_learning.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@

# or just use the Infidelity optimisation driver
optimizer = nk.optimizer.Adam()
driver = nkf.driver.InfidelityOptimizer(
vs_target, optimizer, variational_state=vs
)
driver = nkf.driver.InfidelityOptimizer(vs_target, optimizer, variational_state=vs)

log = nk.logging.RuntimeLog()
driver.run(300, out=log)

plt.ion()
plt.semilogy(log.data['Infidelity'].iters, log.data['Infidelity'])
plt.show()
plt.semilogy(log.data["Infidelity"].iters, log.data["Infidelity"])
plt.show()
4 changes: 2 additions & 2 deletions netket_fidelity/driver/infidelity_optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def __init__(
U_dagger=None,
preconditioner: PreconditionerT = identity_preconditioner,
is_unitary=False,
sample_Upsi=False,
sample_Upsi=False,
cv_coeff=-0.5,
):
r"""
Expand Down Expand Up @@ -135,7 +135,7 @@ def __init__(
U_dagger=U_dagger,
is_unitary=is_unitary,
cv_coeff=cv_coeff,
sample_Upsi=sample_Upsi,
sample_Upsi=sample_Upsi,
)

def _forward_and_backward(self):
Expand Down

0 comments on commit 99f2f35

Please sign in to comment.