Skip to content

ag/gradgrad b fix#24

Open
andrewgiuliani wants to merge 5 commits intolandreman:mainfrom
andrewgiuliani:ag/gradgradB_fix
Open

ag/gradgrad b fix#24
andrewgiuliani wants to merge 5 commits intolandreman:mainfrom
andrewgiuliani:ag/gradgradB_fix

Conversation

@andrewgiuliani
Copy link

@andrewgiuliani andrewgiuliani commented May 29, 2025

I noticed that the conversion of the gradgradB tensor from Frenet to cylindrical does not appear correct in the current version of the code. This PR attempts to fix the conversion of the gradgradB tensor from Frenet to cylindrical, and as well cylindrical to Cartesian coordinates. We propose a fix in this PR with @rogeriojorge and @mishapadidar.

The unit test that I wrote depends on simsopt for convenience. It would take some work to remove this dependence.

I have also added an additional unit test as described here:
image

@andrewgiuliani
Copy link
Author

Are there any other unit tests that might be useful here @rogeriojorge @landreman ?

@rogeriojorge
Copy link
Collaborator

After commenting out the line
np.testing.assert_almost_equal(np.transpose(stel.grad_grad_B, (1, 2, 3, 0)), dBdxdx_cylindrical)
this passes all existing pyQSC tests.
On my tests this is true but @andrewgiuliani can you check if L_gradgradB is the same for the different configurations after this fix? The reasoning is that this might alter the components of gradgradB but not its gradient scale length.

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