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

Allow scalars and Arrays in FieldTuples #80

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

marius311
Copy link
Owner

Eg:

using CMBLensing, LinearAlgebra

f = FlatMap(rand(10,10))
ft = FieldTuple(;f, AL=1., r=0, Aϕ=[1,2])

ft2 = ft .+ ft # broadcasting works
ft3 = Diagonal(ft2) * ft # diagonal operators
ft3'ft3 # inner prod
(;f, AL) = ft2 # unpacking components

gradient(ft -> norm(Diagonal(ft)*ft), ft)[1] # gradients work

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

Successfully merging this pull request may close these issues.

1 participant