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

Scalar broadcasting for Particles, Directions, Spins and Polarization #62

Merged
merged 6 commits into from
May 14, 2024

Conversation

szabo137
Copy link
Member

@szabo137 szabo137 commented May 14, 2024

We add scalar broadcasting for AbstractParticle, ParticleDirection, and AbstractSpinOrPolarization. For instance, if one has a function func(spin::SpinUp,x::Real) and wants to perform a broadcast over x, one can now do

x_vec = rand(10)
func.(SpinUp(),x_vec)

instead of func.(Ref(SpinUp()),x_vec).

@szabo137 szabo137 marked this pull request as ready for review May 14, 2024 11:40
@szabo137 szabo137 requested a review from AntonReinhard May 14, 2024 11:40
test/particles.jl Outdated Show resolved Hide resolved
test/particles.jl Outdated Show resolved Hide resolved
Copy link
Member Author

@szabo137 szabo137 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, you are right!

Co-authored-by: Anton Reinhard <[email protected]>
@szabo137 szabo137 merged commit 8c1d5dd into QEDjl-project:dev May 14, 2024
4 checks passed
@szabo137 szabo137 added this to the Release-next milestone May 14, 2024
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.

2 participants