Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7155a1a
fix for appending samples from loaded models
rozyczko Dec 5, 2025
9d8bc4a
added unit tests
rozyczko Dec 8, 2025
820896b
use most recent version of refl1d
rozyczko Dec 12, 2025
46d143b
update docs to include add_sample_from_orso
rozyczko Jan 2, 2026
dc8c19d
temporarily revert to fwhm
rozyczko Jan 13, 2026
d3712c9
fixed ruff. Tests temporarily fail
rozyczko Jan 13, 2026
40b5d0d
minor fixes after CR + ruff format
rozyczko Jan 30, 2026
205db70
back to pointwise
rozyczko Jan 31, 2026
03f0da3
bilayer class
rozyczko Jan 31, 2026
fac389f
bilayer notebook and docs
rozyczko Jan 31, 2026
efe523a
PR review #1
rozyczko Feb 2, 2026
4333c43
Updated notebook after PR
rozyczko Feb 2, 2026
653ac9d
proper conversion from stack to layers.
rozyczko Feb 5, 2026
a223523
ruff
rozyczko Feb 5, 2026
4db44ff
added method
rozyczko Feb 9, 2026
b288622
temporarily switch off pointwise
rozyczko Feb 11, 2026
c03c007
fixed SLD read.
rozyczko Feb 11, 2026
82983a0
added handling for orso names (model and experiment)
rozyczko Feb 11, 2026
0a2812c
ruff
rozyczko Feb 11, 2026
beeca49
minor fix for names
rozyczko Feb 11, 2026
b703e83
functionality review issues addressed
rozyczko Feb 12, 2026
7217924
more PR review comments addressed
rozyczko Feb 12, 2026
04ece9f
CR review fixes
rozyczko Feb 13, 2026
c76c45d
model reindexing issue fixed. Project rst added
rozyczko Feb 13, 2026
88ce6aa
path for SLD-less orso files
rozyczko Feb 13, 2026
93cc0f6
ruff
rozyczko Feb 13, 2026
707b397
Merge branch 'append_sample' into bilayer
rozyczko Feb 15, 2026
d503c0a
Merge branch 'develop' into bilayer
rozyczko Feb 27, 2026
e6c06f8
ruff
rozyczko Feb 27, 2026
2f925b7
Merge branch 'develop' into bilayer
rozyczko Mar 5, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 90 additions & 1 deletion docs/src/tutorials/basic/assemblies_library.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,97 @@ Furthermore, as shown in the `surfactant monolayer tutorial`_ the conformal roug

The use of the :py:class:`SurfactantLayer` in multiple contrast data analysis is shown in a `multiple contrast tutorial`_.

:py:class:`Bilayer`
-------------------

The :py:class:`Bilayer` assembly type represents a phospholipid bilayer at an interface.
It consists of two surfactant layers where one is inverted, creating the structure:

.. code-block:: text

Head₁ - Tail₁ - Tail₂ - Head₂

This assembly is particularly useful for studying supported lipid bilayers and membrane systems.
The bilayer comes pre-populated with physically meaningful constraints:

- Both tail layers share the same structural parameters (thickness, area per molecule)
- Head layers share thickness and area per molecule (different hydration/solvent fraction allowed)
- A single roughness parameter applies to all interfaces (conformal roughness)

These default constraints can be enabled or disabled as needed for specific analyses.

The creation of a :py:class:`Bilayer` object is shown below.

.. code-block:: python

from easyreflectometry.sample import Bilayer
from easyreflectometry.sample import LayerAreaPerMolecule
from easyreflectometry.sample import Material

# Create materials for solvents
d2o = Material(sld=6.36, isld=0.0, name='D2O')
air = Material(sld=0.0, isld=0.0, name='Air')

# Create head layer (used for front, back head will be auto-created with constraints)
head = LayerAreaPerMolecule(
molecular_formula='C10H18NO8P',
thickness=10.0,
solvent=d2o,
solvent_fraction=0.3,
area_per_molecule=48.2,
roughness=3.0,
name='DPPC Head'
)

# Create tail layer (both tail positions will share these parameters)
tail = LayerAreaPerMolecule(
molecular_formula='C32D64',
thickness=16.0,
solvent=air,
solvent_fraction=0.0,
area_per_molecule=48.2,
roughness=3.0,
name='DPPC Tail'
)

# Create bilayer with default constraints
bilayer = Bilayer(
front_head_layer=head,
tail_layer=tail,
constrain_heads=True,
conformal_roughness=True,
name='DPPC Bilayer'
)

The head layers can have different solvent fractions (hydration) even when constrained,
enabling the modeling of asymmetric bilayers at interfaces where the two sides of the
bilayer may have different solvent exposure.

The constraints can be controlled at runtime:

.. code-block:: python

# Disable head constraints to allow different head layer structures
bilayer.constrain_heads = False

# Disable conformal roughness to allow different roughness values
bilayer.conformal_roughness = False

Individual layers can be accessed via properties:

.. code-block:: python

# Access the four layers
bilayer.front_head_layer # First head layer
bilayer.front_tail_layer # First tail layer
bilayer.back_tail_layer # Second tail layer (constrained to front tail)
bilayer.back_head_layer # Second head layer

For more detailed examples including simulation and parameter access, see the `bilayer tutorial`_.


.. _`simple fitting tutorial`: ../tutorials/simple_fitting.html
.. _`tutorial`: ../tutorials/repeating.html
.. _`surfactant monolayer tutorial`: ../tutorials/monolayer.html
.. _`multiple contrast tutorial`: ../tutorials/multi_contrast.html
.. _`multiple contrast tutorial`: ../tutorials/multi_contrast.html
.. _`bilayer tutorial`: ../tutorials/simulation/bilayer.html
Loading
Loading