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

Polar components on tensors #295

Merged
merged 1 commit into from
Jul 18, 2024
Merged

Polar components on tensors #295

merged 1 commit into from
Jul 18, 2024

Conversation

lecoanet
Copy link
Member

Right now, the polar component operators (PolarRadialComponent and PolarAzimuthalComponent) assume they are acting on vectors. This PR allows the operators to act on tensors.

input_dim = len(operand.tensorsig)
output_dim = len(self.tensorsig)
matrix = []
for output in range(2**output_dim):

Choose a reason for hiding this comment

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

you can vectorise this part with numpy instead of using two for loops

Copy link
Member Author

Choose a reason for hiding this comment

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

How would you suggest that we vectorize this?

@lecoanet
Copy link
Member Author

@kburns I had intended to add some tests to this, but it is pretty tricky to set up a test for this type of problem (non-square operator). So I think we might want to just merge this in directly. Thoughts?

@kburns kburns merged commit 4735501 into master Jul 18, 2024
@kburns kburns deleted the polar_components branch July 18, 2024 19:25
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.

None yet

3 participants