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

Add warning to complex-field nonlinearities #2068

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

caseyflex
Copy link
Contributor

@caseyflex caseyflex commented Nov 13, 2024

Some of the nonlinearities use complex fields to realize certain effects, which may be a good model in certain circumstances but can deviate from the underlying physics. I added some warnings to make sure that the user knows what they are doing (and doesn't inadvertently use KerrNonlinearity when NonlinearSusceptibility is more appropriate, for example). These warnings will always show whenever complex-field nonlinearities are present.

log.warning(
"Found a medium with a 'TwoPhotonAbsorption' nonlinearity. "
"This uses a phenomenological model based on complex fields, "
"so care should be taken in interpreting the results."
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we reference something for more information?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@tomflexcompute tomflexcompute left a comment

Choose a reason for hiding this comment

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

Thanks Casey.

Copy link
Contributor

@FilipeFcp FilipeFcp left a comment

Choose a reason for hiding this comment

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

Nice. This will be useful for the users.

@momchil-flex momchil-flex merged commit ef715d5 into develop Nov 14, 2024
15 checks passed
@momchil-flex momchil-flex deleted the casey/warnnonlinear branch November 14, 2024 11:04
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.

4 participants