Skip to content
Snippets Groups Projects
Commit 50c35bfe authored by patavirt's avatar patavirt
Browse files

solver: fix cpr vs. singlet & solver reset

parent 1cda610f
No related branches found
No related tags found
No related merge requests found
...@@ -1155,6 +1155,7 @@ def _self_consistent_Delta_f( ...@@ -1155,6 +1155,7 @@ def _self_consistent_Delta_f(
mask = mask1 & mask2 mask = mask1 & mask2
solver.Delta[mask] = singlet_m(Delta[mask]) solver.Delta[mask] = singlet_m(Delta[mask])
solver.reset()
if workers is not None: if workers is not None:
jobs = [] jobs = []
...@@ -1406,11 +1407,11 @@ def cpr( ...@@ -1406,11 +1407,11 @@ def cpr(
# Corrector # Corrector
def constraint_fun(phi, Delta): def constraint_fun(phi, Delta):
# Pseudoarclength constraint # Pseudoarclength constraint
Delta[phase_mask] = Delta_00[phase_mask] * np.exp(1j * phi) Delta[phase_mask] = singlet(Delta_00[phase_mask]) * np.exp(1j * phi)
m = solver.mask == MASK_NONE m = solver.mask == MASK_NONE
dsa = theta * np.real( dsa = theta * np.real(
np.vdot(dDelta[m], Delta[m] - state.Deltas[-1][m]) np.vdot(singlet(dDelta[m]), Delta[m] - singlet(state.Deltas[-1][m]))
) )
dsb = (1 - theta) * dphi * (phi - state.phis[-1]) dsb = (1 - theta) * dphi * (phi - state.phis[-1])
dstot = dsa + dsb dstot = dsa + dsb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment