From 4a4d7885206e649d45608f6d5e7b5e9018102dfd Mon Sep 17 00:00:00 2001 From: Chad Mitchell Date: Tue, 7 Jun 2022 15:47:07 -0700 Subject: [PATCH 01/13] Examples for 3D space charge benchmarking - Modified the initial beam size in the IOTA lens benchmark example. - Added 2 benchmarks of 3D space charge for initial testing. - Add documentation for 2 benchmarks with space charge. - Add a benchmark example with space charge and periodic s-dependent focusing. - Added an s-dependent example using a Kurth beam without space charge. - Modified tolerance for IOTA lens benchmark example. Reduced tolerance to account for smaller initial beam size and improved preservation of invariants of motion. - Modified tolerances of space charge examples to allow CI tests to pass when space charge is not active. - Modified tolerance for space charge examples. These should fail unless space charge is turned on. --- examples/kurth/input_kurth_10nC.in | 37 ++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 examples/kurth/input_kurth_10nC.in diff --git a/examples/kurth/input_kurth_10nC.in b/examples/kurth/input_kurth_10nC.in new file mode 100644 index 000000000..be1a3611d --- /dev/null +++ b/examples/kurth/input_kurth_10nC.in @@ -0,0 +1,37 @@ +############################################################################### +# Particle Beam(s) +############################################################################### +beam.npart = 10000 +beam.units = static +beam.energy = 2.0e3 +beam.charge = 1.0e-8 +beam.particle = proton +beam.distribution = kurth6d +beam.sigmaX = 1.2154443728379865788e-3 +beam.sigmaY = 1.2154443728379865788e-3 +beam.sigmaT = 4.0956844276541331005e-4 +beam.sigmaPx = 8.2274435782286157175e-4 +beam.sigmaPy = 8.2274435782286157175e-4 +beam.sigmaPt = 2.4415943602685364584e-3 + + +############################################################################### +# Beamline: lattice elements and segments +############################################################################### +lattice.elements = constf1 + +constf1.type = constf +constf1.ds = 2.0 +constf1.kx = 1.0 +constf1.ky = 1.0 +constf1.kt = 1.0 + + +############################################################################### +# Algorithms +############################################################################### +algo.particle_shape = 2 +algo.space_charge = true + +amr.n_cell = 40 40 32 +geometry.prob_relative = 1.0 From 0bffdcd61e8a993d39bf9b083101c92ae96ca3ca Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Mon, 5 Dec 2022 15:14:50 -0800 Subject: [PATCH 02/13] Update input_kurth_10nC.in Selected numerical values for amr.n_cell, lattice.nslice, and geometry.prob_relative. --- examples/kurth/input_kurth_10nC.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/kurth/input_kurth_10nC.in b/examples/kurth/input_kurth_10nC.in index be1a3611d..6349bfdda 100644 --- a/examples/kurth/input_kurth_10nC.in +++ b/examples/kurth/input_kurth_10nC.in @@ -2,6 +2,7 @@ # Particle Beam(s) ############################################################################### beam.npart = 10000 +#beam.npart = 100000 #optional for increased precision beam.units = static beam.energy = 2.0e3 beam.charge = 1.0e-8 @@ -19,6 +20,8 @@ beam.sigmaPt = 2.4415943602685364584e-3 # Beamline: lattice elements and segments ############################################################################### lattice.elements = constf1 +lattice.nslice = 50 +#lattice.nslice = 100 #optional for increased precision constf1.type = constf constf1.ds = 2.0 @@ -33,5 +36,6 @@ constf1.kt = 1.0 algo.particle_shape = 2 algo.space_charge = true -amr.n_cell = 40 40 32 +amr.n_cell = 48 48 40 +#amr.n_cell = 72 72 72 #optional for increased precision geometry.prob_relative = 1.0 From 9d1773329ceaff0520a53c2d809e4a87d7cb91f4 Mon Sep 17 00:00:00 2001 From: Chad Mitchell Date: Tue, 16 Apr 2024 14:25:02 -0700 Subject: [PATCH 03/13] Add README documentation for examples/distgen --- examples/distgen/README.rst | 263 ++++++++++++++++++++++++++++++++++++ 1 file changed, 263 insertions(+) create mode 100644 examples/distgen/README.rst diff --git a/examples/distgen/README.rst b/examples/distgen/README.rst new file mode 100644 index 000000000..c5642e011 --- /dev/null +++ b/examples/distgen/README.rst @@ -0,0 +1,263 @@ + +Generation of beam distributions +================================= + +The following examples are tests of beam initialization for distributions of various types. + +In each example, we use a 2 GeV electron beam with initial unnormalized rms emittance of 2 nm. + +The matched Twiss parameters are the same as those used in the FODO example: + +* :math:`\beta_\mathrm{x} = 2.82161941` m +* :math:`\alpha_\mathrm{x} = -1.59050035` +* :math:`\beta_\mathrm{y} = 2.82161941` m +* :math:`\alpha_\mathrm{y} = 1.59050035` + +The second moments of the particle distribution after the FODO cell should coincide with the second moments of the particle distribution before the FODO cell, to within the level expected due to noise due to statistical sampling. + +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. + + +.. _examples-gaussian: + +A 6d Gaussian distribution +============================ + +A Gaussian distribution in all 6 phase space variables. + +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> + + +Run +--- + +This example can be run **either** as: + +* **Python** script: ``python3 run_gaussian.py`` or +* ImpactX **executable** using an input file: ``impactx input_gaussian.in`` + +For `MPI-parallel `__ runs, prefix these lines with ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system. + +.. tab-set:: + + .. tab-item:: Python: Script + + .. literalinclude:: run_gaussian.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/run_gaussian.py``. + + .. tab-item:: Executable: Input File + + .. literalinclude:: input_gaussian.in + :language: ini + :caption: You can copy this file from ``examples/distgen/input_gaussian.in``. + + +Analyze +------- + +We run the following script to analyze correctness: + +.. dropdown:: Script ``analysis_gaussian.py`` + + .. literalinclude:: analysis_gaussian.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/analysis_gaussian.py``. + + + +.. _examples-kvdist: + +A Kapchinskij-Vladimirskij (K-V) distribution +=============================================== + +A 4D K-V distribution in the transverse phase space variables ( + a longitudinally uniform distribution in t + a Gaussian distribution in p_t ). + +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> + + +Run +--- + +This example can be run **either** as: + +* **Python** script: ``python3 run_kvdist.py`` or +* ImpactX **executable** using an input file: ``impactx input_kvdist.in`` + +For `MPI-parallel `__ runs, prefix these lines with ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system. + +.. tab-set:: + + .. tab-item:: Python: Script + + .. literalinclude:: run_kvdist.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/run_kvdist.py``. + + .. tab-item:: Executable: Input File + + .. literalinclude:: input_kvdist.in + :language: ini + :caption: You can copy this file from ``examples/distgen/input_kvdist.in``. + + +Analyze +------- + +We run the following script to analyze correctness: + +.. dropdown:: Script ``analysis_kvdist.py`` + + .. literalinclude:: analysis_kvdist.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/analysis_kvdist.py``. + + + + +.. _examples-kvdist_from_twiss: + +A K-V distribution initialized from Twiss functions +====================================================== + +Identical to the previous example (examples-kvdist), but initialized using Courant-Snyder Twiss functions. + +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> + + +Run +--- + +This example can be run **either** as: + +* **Python** script: ``python3 run_kvdist_from_twiss.py`` or +* ImpactX **executable** using an input file: ``impactx input_kvdist_from_twiss.in`` + +For `MPI-parallel `__ runs, prefix these lines with ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system. + +.. tab-set:: + + .. tab-item:: Python: Script + + .. literalinclude:: run_kvdist_from_twiss.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/run_kvdist_from_twiss.py``. + + .. tab-item:: Executable: Input File + + .. literalinclude:: input_kvdist_from_twiss.in + :language: ini + :caption: You can copy this file from ``examples/distgen/input_kvdist_from_twiss.in``. + + +Analyze +------- + +We run the following script to analyze correctness: + +.. dropdown:: Script ``analysis_kvdist_from_twiss.py`` + + .. literalinclude:: analysis_kvdist_from_twiss.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/analysis_kvdist_from_twiss.py``. + + + + +.. _examples-kurth4d: + +A 4D Kurth Distribution +============================ + +A 4D Kurth distribution in the transverse phase space variables ( + a longitudinally uniform distribution in t + a Gaussian distribution in p_t ). + + +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> + + +Run +--- + +This example can be run **either** as: + +* **Python** script: ``python3 run_kurth4d.py`` or +* ImpactX **executable** using an input file: ``impactx input_kurth4d.in`` + +For `MPI-parallel `__ runs, prefix these lines with ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system. + +.. tab-set:: + + .. tab-item:: Python: Script + + .. literalinclude:: run_kurth4d.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/run_kurth4d.py``. + + .. tab-item:: Executable: Input File + + .. literalinclude:: input_kurth4d.in + :language: ini + :caption: You can copy this file from ``examples/distgen/input_kurth4d.in``. + + +Analyze +------- + +We run the following script to analyze correctness: + +.. dropdown:: Script ``analysis_kurth4d.py`` + + .. literalinclude:: analysis_kurth4d.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/analysis_kurth4d.py``. + + + + +.. _examples-semigaussian: + +A Semigaussian distribution +============================ + +A 6D semigaussian distribution (uniform in position, Gaussian in momentum). + +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> + + +Run +--- + +This example can be run **either** as: + +* **Python** script: ``python3 run_semigaussian.py`` or +* ImpactX **executable** using an input file: ``impactx input_semigaussian.in`` + +For `MPI-parallel `__ runs, prefix these lines with ``mpiexec -n 4 ...`` or ``srun -n 4 ...``, depending on the system. + +.. tab-set:: + + .. tab-item:: Python: Script + + .. literalinclude:: run_semigaussian.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/run_semigaussian.py``. + + .. tab-item:: Executable: Input File + + .. literalinclude:: input_semigaussian.in + :language: ini + :caption: You can copy this file from ``examples/distgen/input_semigaussian.in``. + + +Analyze +------- + +We run the following script to analyze correctness: + +.. dropdown:: Script ``analysis_semigaussian.py`` + + .. literalinclude:: analysis_semigaussian.py + :language: python3 + :caption: You can copy this file from ``examples/distgen/analysis_semigaussian.py``. + + From 457c9b7589655d72317039afbe2fbb46212e2a0f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Apr 2024 21:28:06 +0000 Subject: [PATCH 04/13] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/distgen/README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/examples/distgen/README.rst b/examples/distgen/README.rst index c5642e011..b25d83b5d 100644 --- a/examples/distgen/README.rst +++ b/examples/distgen/README.rst @@ -259,5 +259,3 @@ We run the following script to analyze correctness: .. literalinclude:: analysis_semigaussian.py :language: python3 :caption: You can copy this file from ``examples/distgen/analysis_semigaussian.py``. - - From 2fe9dfa3cce897cb23a52dc884432f6545377555 Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:28:13 -0700 Subject: [PATCH 05/13] Delete examples/kurth/input_kurth_10nC.in Not part of this PR. --- examples/kurth/input_kurth_10nC.in | 41 ------------------------------ 1 file changed, 41 deletions(-) delete mode 100644 examples/kurth/input_kurth_10nC.in diff --git a/examples/kurth/input_kurth_10nC.in b/examples/kurth/input_kurth_10nC.in deleted file mode 100644 index 6349bfdda..000000000 --- a/examples/kurth/input_kurth_10nC.in +++ /dev/null @@ -1,41 +0,0 @@ -############################################################################### -# Particle Beam(s) -############################################################################### -beam.npart = 10000 -#beam.npart = 100000 #optional for increased precision -beam.units = static -beam.energy = 2.0e3 -beam.charge = 1.0e-8 -beam.particle = proton -beam.distribution = kurth6d -beam.sigmaX = 1.2154443728379865788e-3 -beam.sigmaY = 1.2154443728379865788e-3 -beam.sigmaT = 4.0956844276541331005e-4 -beam.sigmaPx = 8.2274435782286157175e-4 -beam.sigmaPy = 8.2274435782286157175e-4 -beam.sigmaPt = 2.4415943602685364584e-3 - - -############################################################################### -# Beamline: lattice elements and segments -############################################################################### -lattice.elements = constf1 -lattice.nslice = 50 -#lattice.nslice = 100 #optional for increased precision - -constf1.type = constf -constf1.ds = 2.0 -constf1.kx = 1.0 -constf1.ky = 1.0 -constf1.kt = 1.0 - - -############################################################################### -# Algorithms -############################################################################### -algo.particle_shape = 2 -algo.space_charge = true - -amr.n_cell = 48 48 40 -#amr.n_cell = 72 72 72 #optional for increased precision -geometry.prob_relative = 1.0 From 8b49b1434e961da695978ddc9992279f732c700d Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 14:30:57 -0700 Subject: [PATCH 06/13] Update README.rst Fix line breaks. --- examples/distgen/README.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/examples/distgen/README.rst b/examples/distgen/README.rst index b25d83b5d..e138fc79d 100644 --- a/examples/distgen/README.rst +++ b/examples/distgen/README.rst @@ -25,7 +25,7 @@ A 6d Gaussian distribution A Gaussian distribution in all 6 phase space variables. -In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. Run @@ -73,7 +73,7 @@ A Kapchinskij-Vladimirskij (K-V) distribution A 4D K-V distribution in the transverse phase space variables ( + a longitudinally uniform distribution in t + a Gaussian distribution in p_t ). -In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. Run @@ -122,7 +122,7 @@ A K-V distribution initialized from Twiss functions Identical to the previous example (examples-kvdist), but initialized using Courant-Snyder Twiss functions. -In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. Run @@ -172,8 +172,7 @@ A 4D Kurth Distribution A 4D Kurth distribution in the transverse phase space variables ( + a longitudinally uniform distribution in t + a Gaussian distribution in p_t ). -In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> - +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. Run --- @@ -221,7 +220,7 @@ A Semigaussian distribution A 6D semigaussian distribution (uniform in position, Gaussian in momentum). -In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree wi> +In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. Run From 918593643fa8c514b3f4d2a5e00189e64985779a Mon Sep 17 00:00:00 2001 From: Chad Mitchell Date: Tue, 16 Apr 2024 15:36:53 -0700 Subject: [PATCH 07/13] Add examples/distgen in docs/source/usage/examples.rst --- docs/source/usage/examples.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/source/usage/examples.rst b/docs/source/usage/examples.rst index 84821f942..35a8f0146 100644 --- a/docs/source/usage/examples.rst +++ b/docs/source/usage/examples.rst @@ -51,10 +51,7 @@ Beam Distributions :maxdepth: 1 examples/initialize_from_array/README.rst - -.. note:: - - We need to document the ``examples/distgen/`` examples here. + examples/distgen/README.rst Lattice Design & Optimization From 5019cdd27611eb4df657f47a19f9d2ebd6e33017 Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 15:39:53 -0700 Subject: [PATCH 08/13] Update README.rst Changed t, pt to math mode. --- examples/distgen/README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/distgen/README.rst b/examples/distgen/README.rst index e138fc79d..fa865e711 100644 --- a/examples/distgen/README.rst +++ b/examples/distgen/README.rst @@ -71,7 +71,7 @@ We run the following script to analyze correctness: A Kapchinskij-Vladimirskij (K-V) distribution =============================================== -A 4D K-V distribution in the transverse phase space variables ( + a longitudinally uniform distribution in t + a Gaussian distribution in p_t ). +A 4D K-V distribution in the transverse phase space variables ( + a longitudinally uniform distribution in :math:`t` + a Gaussian distribution in :math:`p_t` ). In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. @@ -169,7 +169,7 @@ We run the following script to analyze correctness: A 4D Kurth Distribution ============================ -A 4D Kurth distribution in the transverse phase space variables ( + a longitudinally uniform distribution in t + a Gaussian distribution in p_t ). +A 4D Kurth distribution in the transverse phase space variables ( + a longitudinally uniform distribution in :math:`t` + a Gaussian distribution in :math:`p_t` ). In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. From cc500006156c235af2502b84e3e38ea16e2bd3f1 Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:59:59 -0700 Subject: [PATCH 09/13] Update README.rst Modify README to create tabs/subheadings --- examples/distgen/README.rst | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/examples/distgen/README.rst b/examples/distgen/README.rst index fa865e711..5504a582d 100644 --- a/examples/distgen/README.rst +++ b/examples/distgen/README.rst @@ -18,10 +18,10 @@ The second moments of the particle distribution after the FODO cell should coinc In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_y`, :math:`\lambda_t`, :math:`\epsilon_x`, :math:`\epsilon_y`, and :math:`\epsilon_t` must agree with nominal values. -.. _examples-gaussian: +.. _examples-distgen-gaussian: A 6d Gaussian distribution -============================ +---------------------------- A Gaussian distribution in all 6 phase space variables. @@ -66,10 +66,10 @@ We run the following script to analyze correctness: -.. _examples-kvdist: +.. _examples-distgen-kvdist: A Kapchinskij-Vladimirskij (K-V) distribution -=============================================== +----------------------------------------------- A 4D K-V distribution in the transverse phase space variables ( + a longitudinally uniform distribution in :math:`t` + a Gaussian distribution in :math:`p_t` ). @@ -115,10 +115,10 @@ We run the following script to analyze correctness: -.. _examples-kvdist_from_twiss: +.. _examples-distgen-kvdist_from_twiss: A K-V distribution initialized from Twiss functions -====================================================== +------------------------------------------------------ Identical to the previous example (examples-kvdist), but initialized using Courant-Snyder Twiss functions. @@ -164,10 +164,10 @@ We run the following script to analyze correctness: -.. _examples-kurth4d: +.. _examples-distgen-kurth4d: A 4D Kurth Distribution -============================ +---------------------------- A 4D Kurth distribution in the transverse phase space variables ( + a longitudinally uniform distribution in :math:`t` + a Gaussian distribution in :math:`p_t` ). @@ -213,10 +213,10 @@ We run the following script to analyze correctness: -.. _examples-semigaussian: +.. _examples-distgen-semigaussian: A Semigaussian distribution -============================ +----------------------------- A 6D semigaussian distribution (uniform in position, Gaussian in momentum). From 5c8cd229a5ac0bf6e28153409e55036735fea23b Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:02:02 -0700 Subject: [PATCH 10/13] Update examples.rst Modify docs/source/usage/examples.rst to add subheading for distgen. --- docs/source/usage/examples.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/source/usage/examples.rst b/docs/source/usage/examples.rst index 35a8f0146..dc95c7891 100644 --- a/docs/source/usage/examples.rst +++ b/docs/source/usage/examples.rst @@ -48,11 +48,11 @@ Beam Distributions ------------------ .. toctree:: - :maxdepth: 1 - - examples/initialize_from_array/README.rst - examples/distgen/README.rst + :maxdepth: 2 + examples/initialize_from_array/README + examples/distgen/README + examples/distgen/README.rst #subsection here Lattice Design & Optimization ----------------------------- From d000d35fa93115073b8b331e1c1a6cc13b22738f Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:09:02 -0700 Subject: [PATCH 11/13] Update README.rst Try modifying headings. --- examples/distgen/README.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/distgen/README.rst b/examples/distgen/README.rst index 5504a582d..77c3ce0c9 100644 --- a/examples/distgen/README.rst +++ b/examples/distgen/README.rst @@ -1,6 +1,6 @@ Generation of beam distributions -================================= +*************************************** The following examples are tests of beam initialization for distributions of various types. @@ -21,7 +21,7 @@ In this test, the initial and final values of :math:`\lambda_x`, :math:`\lambda_ .. _examples-distgen-gaussian: A 6d Gaussian distribution ----------------------------- +============================= A Gaussian distribution in all 6 phase space variables. @@ -69,7 +69,7 @@ We run the following script to analyze correctness: .. _examples-distgen-kvdist: A Kapchinskij-Vladimirskij (K-V) distribution ------------------------------------------------ +=============================================== A 4D K-V distribution in the transverse phase space variables ( + a longitudinally uniform distribution in :math:`t` + a Gaussian distribution in :math:`p_t` ). @@ -118,7 +118,7 @@ We run the following script to analyze correctness: .. _examples-distgen-kvdist_from_twiss: A K-V distribution initialized from Twiss functions ------------------------------------------------------- +====================================================== Identical to the previous example (examples-kvdist), but initialized using Courant-Snyder Twiss functions. @@ -167,7 +167,7 @@ We run the following script to analyze correctness: .. _examples-distgen-kurth4d: A 4D Kurth Distribution ----------------------------- +============================ A 4D Kurth distribution in the transverse phase space variables ( + a longitudinally uniform distribution in :math:`t` + a Gaussian distribution in :math:`p_t` ). @@ -216,7 +216,7 @@ We run the following script to analyze correctness: .. _examples-distgen-semigaussian: A Semigaussian distribution ------------------------------ +============================= A 6D semigaussian distribution (uniform in position, Gaussian in momentum). From d5c240518db33e84a8a8858c35b552e649ca39c0 Mon Sep 17 00:00:00 2001 From: Chad Mitchell <46825199+cemitch99@users.noreply.github.com> Date: Tue, 16 Apr 2024 17:15:06 -0700 Subject: [PATCH 12/13] Update examples.rst Reduce :maxdepth: for initialize_from_array/README. --- docs/source/usage/examples.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/usage/examples.rst b/docs/source/usage/examples.rst index dc95c7891..0048a4646 100644 --- a/docs/source/usage/examples.rst +++ b/docs/source/usage/examples.rst @@ -48,9 +48,13 @@ Beam Distributions ------------------ .. toctree:: - :maxdepth: 2 + :maxdepth: 1 examples/initialize_from_array/README + +.. toctree:: + :maxdepth: 2 + examples/distgen/README examples/distgen/README.rst #subsection here From 94d32f5fe9608174543250af1588fd5c88bfc71d Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Tue, 23 Apr 2024 11:15:48 -0700 Subject: [PATCH 13/13] Clear duplicate line --- docs/source/usage/examples.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/source/usage/examples.rst b/docs/source/usage/examples.rst index 0048a4646..57d1f532d 100644 --- a/docs/source/usage/examples.rst +++ b/docs/source/usage/examples.rst @@ -56,7 +56,6 @@ Beam Distributions :maxdepth: 2 examples/distgen/README - examples/distgen/README.rst #subsection here Lattice Design & Optimization -----------------------------