Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/gpt/ad/forward/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def promote(other, landau_O):

class series(base):
foundation = foundation
__array_ufunc__ = None
__numpy_ufunc__ = None

def __init__(self, terms, landau_O):
self.landau_O = landau_O
Expand Down
10 changes: 10 additions & 0 deletions tests/ad/ad.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,3 +392,13 @@ def plaquette(U):
err2 += abs((ref_b_grad - num_b_grad)[1]) ** 2 + abs((ref_b_grad - num_b_grad)[dbeta]) ** 2
g.message(f"Simple combined forward/reverse test: {err2}")
assert err2 < 1e-12

#####################################
# Test numpy array compatibility
#####################################

On = fad.landau(alpha**2)
series = fad.series(3, On)
arr = np.arange(1, 10, 1)

assert isinstance(((series + arr) - (arr + series)), fad.series)