Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: adjoint interpolation is missing complex conjugation #3955

Closed
jrmaddison opened this issue Jan 7, 2025 · 3 comments · Fixed by #3965
Closed

BUG: adjoint interpolation is missing complex conjugation #3955

jrmaddison opened this issue Jan 7, 2025 · 3 comments · Fixed by #3965
Labels

Comments

@jrmaddison
Copy link
Contributor

jrmaddison commented Jan 7, 2025

Describe the bug
action(adjoint(interpolate(...)), ...) applies transpose interpolation, rather than adjoint interpolation.

Steps to Reproduce

import firedrake as fd
from firedrake.__future__ import interpolate

mesh = fd.UnitIntervalMesh(1)
space = fd.FunctionSpace(mesh, "DG", 0)

expr = interpolate(fd.Constant(1.0j) * fd.TestFunction(space), space)
u = fd.Cofunction(space.dual())
u.dat.data[:] = 1

v = fd.assemble(fd.action(fd.adjoint(expr), u))
print(f"{v.dat.data_ro=}")

displays (with complex Firedrake)

v.dat.data_ro=array([0.+1.j])

which is the complex conjugate of the expected value.

Expected behavior
The action of the adjoint should include the complex conjugation.

Error message
No error.

Environment:
Ubuntu 24.04, complex Firedrake built today.

Additional Info
The _interpolate methods of Interpolator subclasses accept a transpose argument, rather than e.g. adjoint or hermitian_transpose.

@jrmaddison jrmaddison added the bug label Jan 7, 2025
@connorjward
Copy link
Contributor

Is this related to the complex failures in #3939?

@jrmaddison
Copy link
Contributor Author

Is this related to the complex failures in #3939?

No, I'd just missed the conjs for complex.

jrmaddison added a commit to jrmaddison/firedrake that referenced this issue Jan 9, 2025
@jrmaddison
Copy link
Contributor Author

You can see the bug in the test_assemble_interp_adjoint_tensor test in #3939 if f1 is complex.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants