Skip to content

Conversation

@mafshari64
Copy link
Contributor

No description provided.

[16, -16],
[16, -16],
],
picongpu_huygens_surface_positions: typing.List[typing.List[int]] = ([[16, -16], [16, -16], [16, -16]]),
Copy link
Member

Choose a reason for hiding this comment

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

Does this follow our code style rules?

Copy link
Member

@PrometheusPi PrometheusPi Sep 25, 2025

Choose a reason for hiding this comment

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

And why is this set here, if this is also set (in exactly the same way) in the GaussianLaser init?
This looks like code duplication and should be avoided.

if duration <= 0:
raise ValueError(f"laser pulse duration must be > 0. You gave {duration=}.")
# Initialize standard Gaussian laser fields
super().__init__(**kw)
Copy link
Member

Choose a reason for hiding this comment

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

How is the case handled with Laguerre modes?
It looks like that this code just takes them (as they are part of GaussianLaser), but will not treat them correctly in pypicongpu. I think this is not a valid solution.

Issue with:

  • picongpu_laguerre_modes
  • picongpu_laguerre_phases

Copy link
Member

Choose a reason for hiding this comment

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

@steindev, you, as the ultimate authority on lasers 😜, what is your opinion?

@PrometheusPi PrometheusPi added refactoring code change to improve performance or to unify a concept but does not change public API CI:no-compile CI is skipping compile/runtime tests but runs PICMI tests PICMI pypicongpu and picmi related labels Sep 25, 2025
@PrometheusPi PrometheusPi added this to the 0.9.0 / next stable milestone Sep 25, 2025
Copy link
Member

@PrometheusPi PrometheusPi left a comment

Choose a reason for hiding this comment

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

requested changes were included
@steindev please comment/review and decide on merging

@mafshari64
Copy link
Contributor Author

@steindev, @PrometheusPi , @chillenzer
another solution can be in picmi side, define a file with common parameters and then Gauss and dispersive laser inherit from that.

Copy link
Contributor

@chillenzer chillenzer left a comment

Choose a reason for hiding this comment

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

Good idea, thanks for the contribution.

Just blocking this, so we can wait for @steindev. Feel free to dismiss my review, @steindev, once you're done.

Sorry, didn't realise that there was already a solution for this.

@chillenzer
Copy link
Contributor

Also: Have you tested that this works as expected? Test coverage for lasers is poor as of now. Not 100% how default_converts_to interacts with new setup. I think it should be fine but as long as tests are missing...

@chillenzer chillenzer dismissed their stale review October 6, 2025 09:45

Misinterpreted the status of this.

@chillenzer
Copy link
Contributor

Any updates with respect to testing this?

@mafshari64
Copy link
Contributor Author

mafshari64 commented Oct 10, 2025

I ran the main.py instead of picmi.GaussianLaser i used picmi.DispersivePulseLaser. I complied and then ran via tbg and saw the simoutput files.

laser_duration = 30.0e-15 / 2.354820045
laser_pulse_init = 20.0
laser = picmi.DispersivePulseLaser(
    wavelength = 800.e-9, 
    waist = 19.4e-6,
    duration = laser_duration,
    propagation_direction = [0.0, 1.0, 0.0],
    polarization_direction = [1.0, 0.0, 0.0],
    focal_position=[
        float(numberCells[0] * cellSize[0] / 2.0),
        1.05e-3,
        float(numberCells[2] * cellSize[2] / 2.0),
    ],
    centroid_position=[
        float(numberCells[0] * cellSize[0] / 2.0),
        -0.5 * laser_duration * laser_pulse_init * c,
        float(numberCells[2] * cellSize[2] / 2.0),
    ],
    picongpu_polarization_type = picmi.lasers.PolarizationType.LINEAR,
    a0 = 2.3127,
    phi0 = 0.0,
    #picongpu_gdd_si = 37700.0,
)

@chillenzer chillenzer merged commit 09f0a58 into ComputationalRadiationPhysics:dev Oct 10, 2025
10 checks passed
@PrometheusPi
Copy link
Member

@mafshari64 and it works also with the commented out #picongpu_gdd_si = 37700.0 activated?

@mafshari64
Copy link
Contributor Author

I did not add but if you want I can rerun it again.

@PrometheusPi
Copy link
Member

It would be great if you could test it, because right now, we would see no difference if it falls back to the default Gaussian.
Or you just validate the code in incidentField.param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:no-compile CI is skipping compile/runtime tests but runs PICMI tests PICMI pypicongpu and picmi related refactoring code change to improve performance or to unify a concept but does not change public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants