Skip to content

Commit

Permalink
Check that convolutions remain the same after rotating PID basis
Browse files Browse the repository at this point in the history
  • Loading branch information
Radonirinaunimi committed Dec 2, 2024
1 parent ecb8ef5 commit adeb134
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions pineappl_py/tests/test_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,17 +213,34 @@ def test_bins(self, fake_grids):
np.testing.assert_allclose(g.bin_left(1), [2, 3])
np.testing.assert_allclose(g.bin_right(1), [3, 5])

def test_rotate_pidbasis(self, fake_grids):
g = fake_grids.grid_with_generic_convolution(
nb_convolutions=2,
channels=CHANNELS,
orders=ORDERS,
convolutions=[CONVOBJECT, CONVOBJECT],
def test_rotate_pidbasis(
self,
pdf,
download_objects,
gridname: str = "GRID_STAR_WMWP_510GEV_WP-AL-POL.pineappl.lz4",
target_basis: PidBasis = PidBasis.Evol,
):
grid = download_objects(f"{gridname}")
g = Grid.read(grid)

conv_ref = g.convolve(
pdg_convs=g.convolutions,
xfxs=[pdf.polarized_pdf, pdf.unpolarized_pdf],
alphas=pdf.alphasQ,
)
# Rotate the Grid into the PDG basis
g.rotate_pid_basis(PidBasis.Pdg)
assert g.pid_basis == PidBasis.Pdg

# Rotate the Grid into the PDG basis
g.rotate_pid_basis(target_basis)
assert g.pid_basis == target_basis

conv_rot = g.convolve(
pdg_convs=g.convolutions,
xfxs=[pdf.polarized_pdf, pdf.unpolarized_pdf],
alphas=pdf.alphasQ,
)
np.testing.assert_allclose(conv_ref, conv_rot)

def test_delete_orders(
self,
download_objects,
Expand Down

0 comments on commit adeb134

Please sign in to comment.