Skip to content

Commit

Permalink
TL: added Jumper-type QDelta generators
Browse files Browse the repository at this point in the history
  • Loading branch information
tlunet committed Jan 10, 2025
1 parent 0bbe50a commit a38b1d3
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions qmat/qdelta/min.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,24 @@ def computeQDelta(self, k=1):
except AttributeError:
self._QDelta_MIN_SR_S = super().computeQDelta()
return self._QDelta_MIN_SR_S


@register
class Jumper(MIN_SR_NS):
"""Diagonal coefficients allowing order jump"""

aliases = ["JUMPER", "FB"]

def computeQDelta(self, k=None):
if k is None: k = 1
return np.diag(self.nodes)/(2*k)


@register
class FlexJumper(Jumper):
"""Diagonal coefficients allowing order jump while still maintining high stability"""

def computeQDelta(self, k=None):
if k is None: k = 1
divider = 1 if k == 1 else 2*(k-1)
return np.diag(self.nodes)/divider

0 comments on commit a38b1d3

Please sign in to comment.