Skip to main content
Log in

Exact and Efficient Sampling of Conditioned Walks

  • Published:
Journal of Statistical Physics Aims and scope Submit manuscript

Abstract

A computationally challenging and open problem is how to efficiently generate equilibrated samples of conditioned walks. We present here a general stochastic approach that allows one to produce these samples with their correct statistical weight and without rejections. The method is illustrated for a jump process conditioned to evolve within a cylindrical channel and forced to reach one of its ends. We obtain analytically the exact probability density function of the jumps and offer a direct method for gathering equilibrated samples of a random walk conditioned to stay in a channel with suitable boundary conditions. Unbiased walks of arbitrary length can thus be generated with linear computational complexity—even when the channel width is much smaller than the typical bond length of the unconditioned walk. By profiling the metric properties of the generated walks for various bond lengths we characterize the crossover between weak and strong confinement regimes with great detail.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. For \(m\ne n\) one can use Gradshteyn–Ryzhik, 6.521, to check the orthogonality condition; for \(m=n\) one can integrate twice by parts using \(d(x\,J_1(x))/dx = x\,J_0(x)\).

References

  1. Angeletti, F., Touchette, H.: Diffusions conditioned on occupation measures. J. Math. Phys. 57(2), (2016)

  2. Benková, Z., Cifra, P.: Simulation of semiflexible cyclic and linear chains moderately and strongly confined in nanochannels. Macromolecules 45(5), 2597–2608 (2012)

    Article  ADS  Google Scholar 

  3. Berg, H.C.: Random Walks in Biology. Princeton University Press, Princeton (1993)

    Google Scholar 

  4. Bonthuis, D.J., Meyer, C., Stein, D., Dekker, C.: Conformation and Dynamics of DNA Confined in Slitlike Nanofluidic Channels. Physical Review Letters 101, (2008)

  5. Bucklew, J.: Introduction to Rare Event Simulation. Springer Science, New York (2004)

    Book  MATH  Google Scholar 

  6. Chen, J.Z.Y.: Free energy and extension of a wormlike chain in tube confinement. Macromolecules 46(24), 9837–9844 (2013)

    Article  ADS  Google Scholar 

  7. Chetrite, R., Touchette, H.: Variational and optimal control representations of conditioned and driven processes. J. Stat. Mech. Theory Exp. 2015(12) (2015)

  8. Chetrite, R., Touchette, H.: Nonequilibrium Markov processes conditioned on large deviations. Annales Henri Poincaré 16(9), 2005–2057 (2015a)

    Article  ADS  MathSciNet  MATH  Google Scholar 

  9. Cifra, P., Benková, Z., Bleha, T.: Persistence Lengths and Structure Factors of Wormlike Polymers under Confinement. J. Phys. Chem. B 112(5), 1367–1375 (2008)

    Article  Google Scholar 

  10. Codling, E.A., Plank, M.J., Benhamou, S.: Random walk models in biology. J. R. Soc. Interface 5 (2008)

  11. Dai, L., van der Maarel, J., Doyle, P.S.: Extended de gennes regime of DNA confined in a nanochannel. Macromolecules 47(7), 2445–2450 (2014)

    Article  ADS  Google Scholar 

  12. Dai, L., Renner, C.B., Doyle, P.S.: The polymer physics of single DNA confined in nanochannels. Adv. Colloid Interface Sci. 232, 80–100 (2016)

    Article  Google Scholar 

  13. Daoud, M., De Gennes, P.: Statistics of macromolecular solutions trapped in small pores. Journal de Physique 38(1), 85–93 (1977)

    Article  Google Scholar 

  14. Diao, Y., Ernst, C., Montemayor, A., Ziegler, U.: Generating equilateral random polygons in confinement. J. Phys. A: Math. Theory 44(40), 405,202 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  15. Diao, Y., Ernst, C., Montemayor, A., Ziegler, U.: Generating equilateral random polygons in confinement ii. J. Phys. A: Math. Theory 45(27), 275,203 (2012a)

    Article  MathSciNet  MATH  Google Scholar 

  16. Diao, Y., Ernst, C., Montemayor, A., Ziegler, U.: Generating equilateral random polygons in confinement iii. J. Phys. A: Math. Theory 45(46), 465,003 (2012b)

    Article  MathSciNet  MATH  Google Scholar 

  17. Doob, J.L.: Conditional Brownian motion and the boundary limits of harmonic functions. Bulletin de la Société Mathématique de France 85, 431–458 (1957)

    Article  MathSciNet  MATH  Google Scholar 

  18. Duke, T., Austin, R.: Microfabricated sieve for the continuous sorting of macromolecules. Phys. Rev. Lett. 80(7), 1552 (1998)

    Article  ADS  Google Scholar 

  19. Egorov, S.A., Milchev, A., Binder, K.: Semiflexible polymers in the bulk and confined by planar walls. Polymers 8(8) (2016)

  20. Frey, E., Kroy, K.: Brownian motion: a paradigm of soft matter and biological physics. Annalen der Physik (1–3) (2005)

  21. Grassberger, P.: Pruned-enriched Rosenbluth method: simulations of \(\theta \) polymers of chain length up to 1 000 000. Phys. Rev. E 56, 3682–3693 (1997)

    Article  ADS  Google Scholar 

  22. Gupta, D., Miller, J., Muralidhar, A., Mahshid, S., Reisner, W., Dorfman, K.D.: Experimental evidence of weak excluded volume effects for nanochannel confined DNA. ACS Macro Lett. 4(7), 759–763 (2015)

    Article  Google Scholar 

  23. Hsu, H., Grassberger, P.: A review of Monte Carlo simulations of polymers with PERM. J. Stat. Phys. 144(3) (2011)

  24. Kampen, N.V.: Stochastic Processes in Physics and Chemistry. North Holland (2007)

  25. Karatzas, I., Shreve, S.E.: Methods of Mathematical Finance. No. 39 in Applications of Mathematics. Springer, New York (1998)

    Book  MATH  Google Scholar 

  26. Klepinger, A.C., Greenier, M.K., Levy, S.L.: Stretching DNA molecules in strongly confining nanofluidic slits. Macromolecules 48(24), 9007–9014 (2015)

    Article  ADS  Google Scholar 

  27. Majumdar, S.N., Orland, H.: Effective Langevin equations for constrained stochastic processes. J. Stat. Mech. Theory Exp. 2015(6) (2015)

  28. Marenda, M., Orlandini, E., Micheletti, C.: Sorting ring polymers by knot type with modulated nanochannels. Soft Matter 13(4), 795–802 (2017)

    Article  ADS  Google Scholar 

  29. Micheletti, C., Orlandini, E.: Knotting and metric scaling properties of dna confined in nano-channels: a monte carlo study. Soft Matter 8(42), 10,959–10,968 (2012)

    Article  Google Scholar 

  30. Micheletti, C., Orlandini, E.: Knotting and unknotting dynamics of dna strands in nanochannels. ACS Macro Lett. 3(9), 876–880 (2014)

    Article  Google Scholar 

  31. Micheletti, C., Marenduzzo, D., Orlandini, E.: Polymers with spatial or topological constraints: theoretical and computational results. Phys. Rep. 504(1), 1–73 (2011)

    Article  ADS  MathSciNet  MATH  Google Scholar 

  32. Michels, J.P.J., Wiegel, F.W.: On the Topology of a Polymer Ring. Proc. R. Soc. A: Math. Phys. Eng. Sci. 403(1825), 269–284 (1986)

    Article  ADS  MathSciNet  MATH  Google Scholar 

  33. Muralidhar, A., Tree, D.R., Wang, Y., Dorfman, K.D.: Interplay between chain stiffness and excluded volume of semiflexible polymers confined in nanochannels. J. Chem. Phys. 140(8) (2014)

  34. Muralidhar, A., Dorfman, K.D.: Kirkwood diffusivity of long semiflexible chains in nanochannel confinement. Macromolecules 48(8), 2829–2839 (2015)

    Article  ADS  Google Scholar 

  35. Odijk, T.: The statistics and dynamics of confined or entangled stiff polymers. Macromolecules 16(8), 1340–1344 (1983)

    Article  ADS  Google Scholar 

  36. Okubo, A., Levin, S.: Diffusion and Ecological Problems, 2nd edn. Springer, Berlin (2001)

    Book  MATH  Google Scholar 

  37. Reisner, W., Morton, K.J., Riehn, R., Wang, Y.M., Yu, Z., Rosen, M., Sturm, J.C., Chou, S.Y., Frey, E., Austin, R.H.: Statics and dynamics of single DNA molecules confined in nanochannels. Phys. Rev. Lett. 94 (2005)

  38. Reisner, W., Pedersen, J.N., Austin, R.H.: DNA confinement in nanochannels: physics and biological applications. Rep. Prog. Phys. 75(10) (2012)

  39. Tegenfeldt, J.O., Prinz, C., Cao, H., Chou, S., Reisner, W.W., Riehn, R., Wang, Y.M., Cox, E.C., Sturm, J.C., Silberzan, P.: The dynamics of genomic-length DNA molecules in 100-nm channels. Proc. Nat. Acad. Sci. U.S.A. 101(30), 10,979–10,983 (2004)

    Article  Google Scholar 

  40. Tree, D.R., Wang, Y., Dorfman, K.D.: Extension of DNA in a nanochannel as a rod-to-coil transition. Phys. Rev. Lett. 110 (2013)

  41. van Kampen, N.G.: Stochastic Processes in Physics and Chemistry. North-Holland (1981)

  42. Wang, Y., Tree, D.R., Dorfman, K.D.: Simulation of DNA extension in nanochannels. Macromolecules 44(16), 6594–6604 (2011)

    Article  ADS  Google Scholar 

  43. Yang, Y., Burkhardt, T.W., Gompper, G.: Free energy and extension of a semiflexible polymer in cylindrical confining geometries. Phys. Rev. E 76 (2007)

Download references

Acknowledgements

We thank Angelo Rosa for useful comments and suggestions.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Matteo Adorisio.

Appendices

Appendix

Generating the Conditioned Ensemble by Rejection

Directly sampling a free random walk with exponentially distributed jumps according to Eq. (3) and then rejecting the trajectories that do not satisfy the condition of staying within a cylinder is very inefficient, especially for long chains and large jumps. Figure 6 shows the efficiency of this brute-force method for different number of jumps and their length. The efficiency falls off exponentially fast to zero as expected. Figure 7 presents a summary of the results concerning the runtime to sequentially produce one hundred trajectories using the rejection method and the method described in this work. In the case of small jump length the rejection method is impractical if one wants to explore the limit of long chains (see Fig. 7 right panel). The other limit is shown in the left panel where the jump length is comparable with the confinement. In this case sampling few hundreds of jumps is impractical. Using the rejection method, the runtime grows exponetially with N in agreement with what shown in Fig. 6. The method we described in this work instead presents a runtime that practically grows linearly with N.

Fig. 6
figure 6

Fraction of free chains that satisfy the constraint as a function of the number of jumps. Colors encode the jump length and N is the number of jumps (Color figure online)

Fig. 7
figure 7

The CPU time required to generate ensembles of 100 paths of length N using the strategy based on Eq. (5) (red points) is compared with the one required by the rejection method (blue points). The two panels correspond to different degrees of channel confinement: \(\ell _f/R = 6 \times 10^{-1}\) and \(\ell _f/R = 6 \times 10^{-1}\) for the left and right panels, respectively. In both cases, the runtime grows linearly with N for the the strategy based on Eq. (5), while it grows exponentially with N for the rejection method. As the chain length is increased, this significant additional computational cost make the rejection scheme impractical compared to the proposed strategy (Color figure online)

Conditioned Random Walks

Let us consider a walker performing independent and identically distributed jumps (of finite size). We denote by \(p(\mathbf {r}'|\mathbf {r})\) the probability density that the walker performs a jump from \(\mathbf {r}\) to \(\mathbf {r}'\). Let us first introduce a terminal domain \(\mathcal{T}\) where the process is absorbed. The joint probability density function of the trajectory \((\mathbf {r}_1, \dots , \mathbf {r}_N)\) starting from \(\mathbf {r}_0\) and with stopping time N reads

$$\begin{aligned} P(\mathbf {r}_1, \dots , \mathbf {r}_N\,|\,\mathbf {r}_0) = \prod _{i=1}^N\, p(\mathbf {r}_i\,|\,\mathbf {r}_{i-1})\,. \end{aligned}$$
(A.1)

Let us now consider a confinement domain \(\mathcal{C}\) disjoint from \(\mathcal{T}\). We want to find the subset of trajectories generated by P that stay inside \(\mathcal{C}\) and terminate in \(\mathcal{T}\). The new joint pdf of the trajectory \((\mathbf {r}_1, \dots , \mathbf {r}_N)\) under the confinement condition can thus be written as

$$\begin{aligned} Q(\mathbf {r}_1, \dots , \mathbf {r}_N\,|\,\mathbf {r}_0) = \frac{\prod _{i=1}^N\, p(\mathbf {r}_i\,|\,\mathbf {r}_{i-1})\, \mathbb {I}_\mathcal{C} (\mathbf {r}_{i})}{Z_N(\mathbf {r}_0)}\,, \end{aligned}$$
(A.2)

where \(\mathbb {I}_\mathcal{C}(\mathbf {r})\) is the characteristic function of \(\mathcal{C}\), i.e. it is one if \(\mathbf {r}\in \mathcal{C}\) and zero otherwise. The normalisation factor

$$\begin{aligned} Z_N(\mathbf {r}_0) = \int \mathrm{d}\mathbf {r}_1\dots \mathrm{d}\mathbf {r}_N\prod _{i=1}^N\, p(\mathbf {r}_i\,|\,\mathbf {r}_{i-1})\,\mathbb {I}_\mathcal{C} (\mathbf {r}_{i}) \,. \end{aligned}$$
(A.3)

is the probability that a trajectory sampled from P does not leave \(\mathcal{C}\) and terminates in \(\mathcal{T}\). The new process Q is still Markovian with transition probability

$$\begin{aligned} q(\mathbf {r}_1\,|\,\mathbf {r}_0) = \frac{Z(\mathbf {r}_1)}{Z(\mathbf {r}_0)} \, p(\mathbf {r}_1\,|\,\mathbf {r}_0)\, \mathbb {I}_\mathcal{C} (\mathbf {r}_{1})\,, \end{aligned}$$
(A.4)

where \(Z(\mathbf {r})\) obeys the backward equation

$$\begin{aligned} Z(\mathbf {r}_0) = \int \mathrm{d}\mathbf {r}_1 \, \mathbb {I}_\mathcal{C} (\mathbf {r}_{1}) Z(\mathbf {r}_1) \,p(\mathbf {r}_1\,|\,\mathbf {r}_0)\,. \end{aligned}$$
(A.5)

The equations above are Eq. (1) and Eq. (2) of the main text.

Randomly Sampled Brownian Motion as a Model of a Freely Jointed Chain

In this Appendix we derive the expression for the transition probability (3) that describes the jump process in free space. Consider a Brownian walker starting from \(\mathbf {r}_0\) at time \(t=0\) and diffusing in a three-dimensional space with a diffusion coefficient D; its position \(\mathbf {r}\) after a time t is given by the probability density function (pdf):

$$\begin{aligned} G_{3d}(\mathbf {r}\, ; \, t \,|\,\mathbf {r}_0) = \frac{1}{(4\pi D t)^{3/2}}\; e^{-\textstyle \frac{(\mathbf {r}-\mathbf {r}_0)^2}{4D t}} \,. \end{aligned}$$
(A.6)

We would like to introduce a characteristic length of the jump process. For this purpose, we sample the Brownian motion at exponentially distributed times with mean \(\tau \), thus defining a discrete random walk (see Fig. 1). By definition, this new process is still Markovian and its successive positions \(\mathbf {r}_i\) are given by the transition probability:

$$\begin{aligned} p(\mathbf {r}_{i+1}\,|\,\mathbf {r}_i) = \int _0^{\infty } \frac{\mathrm{d}t}{\tau } \;< G_{3d}(\mathbf {r}_{i+1} \, ; \, t\,|\,\mathbf {r}_i)\; e^{-\textstyle \frac{t}{\tau }}\,. \end{aligned}$$
(A.7)

where \(\tau \) characterises the coarse-graining. Passing to Fourier space we obtain

$$\begin{aligned} p(\mathbf {r}_{i+1}\,|\,\mathbf {r}_i) = \int \frac{\mathrm{d}^3\mathbf {k}}{(2\pi )^3} \; \frac{m^2}{k^2+ m^2}\;e^{-i \,\mathbf {k}\cdot (\mathbf {r}_{i+1}-\mathbf {r}_i)} \,, \end{aligned}$$
(A.8)

where \(m = 1/\sqrt{\tau D}\), which finally leads to Eq. (3). The jumps \((\mathbf {r}_{i+1}-\mathbf {r}_i)\) are identically distributed with mean length \(\ell _f\doteq \langle ||\mathbf {r}_{i+1}-\mathbf {r}_i||\rangle = 2/m\).

Confining the Jump Process Inside a Cylindrical Channel

In this paragraph we show explicitely how to solve Eq. (2) when the domain \(\mathcal{C}\) is an infinite cylinder and the terminal domain has been pushed to \(z \rightarrow \infty \).

The particular choice (3) for the transition probability \(p(\mathbf {r}'\,|\,\mathbf {r})\) in Eq. (2) presents the advantage of satisfying

$$\begin{aligned} (\varvec{\nabla }^2 - m^2)\,p(\mathbf {r}'\,|\,\mathbf {r}) = -m^2\, \delta (\mathbf {r}'\,-\,\mathbf {r})\,, \end{aligned}$$
(A.9)

where \(\delta \) is a Dirac delta function. Thus applying \(\varvec{\nabla }^2 - m^2\) to Eq. (2) gives

$$\begin{aligned} (\varvec{\nabla }^2 - m^2) \,Z(\mathbf {r})&= -m^2 \int _{\mathcal {C}} \mathrm{d}\mathbf {r}^\prime Z(\mathbf {r}^\prime )\, \delta (\mathbf {r}^\prime -\mathbf {r})\,, \end{aligned}$$

that leads to the system of equations

$$\begin{aligned} {\left\{ \begin{array}{ll} \;\varvec{\nabla }^2 \,Z(\mathbf {r})=0\,, \qquad &{}\mathrm{for }\;\mathbf {r}\;\;\mathrm{in}\;\;\mathcal {C},\\ \;\left( \varvec{\nabla }^2 - m^2\right) \,Z(\mathbf {r}) = 0\,, \qquad &{}\mathrm{elsewhere}. \end{array}\right. } \end{aligned}$$
(A.10)

Given that in cylindrical coordinates the problem is separable in z and \((\theta ,\rho )\), the general solution of Eq. (2) reads

$$\begin{aligned} Z(\mathbf {r})= {\left\{ \begin{array}{ll} A\,\exp (\lambda z) \, J_0\left( \lambda \rho \right) , &{}\quad \mathrm{for}\;\;\mathbf {r}\;\;\mathrm{in}\;\;\mathcal {C}\\ B\,\exp (\lambda z) \,K_0\left( c_{\lambda }\rho \right) , &{}\quad \mathrm{elsewhere,} \end{array}\right. } \end{aligned}$$
(A.11)

where A and B are real constants, \(\lambda \) is a parameter that belongs to (0, m) and satisfies Eq. (6), and \(c_{\lambda }=\sqrt{m^2-\lambda ^2}\). Finally, replacing this solution in Eq. (1) yields the transition probability for the process Eq. (5) conditioned to stay inside the cylinder.

Asymptotic Behavior of \(\lambda R\)

The left panel of Fig. 8 displays the behavior of \(\lambda R\) as a function of \(\ell _f/R\) obtained by solving numerically Eq. (6). In the (diffusive) limit \(\ell _f/R \ll 1\), \(\lambda \) behaves as

$$\begin{aligned} \lambda \,R \sim z_{0,1}\left( 1-\frac{\ell _f}{2\,R}\right) \,, \end{aligned}$$
(A.12)

where \(z_{0,1}\simeq 2.40483\) is the first zero of the Bessel function \(J_0\). In the limit \(\ell _f/R \gg 1\), Eq. (6) gives the asymptotic behavior

$$\begin{aligned} \lambda R&\sim \frac{2R}{\ell _f}\,\left[ 1-\frac{1}{2}\left( \frac{\ell _f}{2R}\right) ^2 \exp \left[ -4\displaystyle \left( \frac{\ell _f}{2R}\right) ^2\right] \right] \,, \end{aligned}$$
(A.13)

using that, in this limit, max\(\,(\lambda R,\sqrt{m^2-\lambda ^2} R) \le mR \ll 1\) and \(c_\lambda R \sim \exp [-2/(mR)^2]\). Note that \(\lambda \,R\in (0, z_{0,1})\) and is a strictly decreasing function of \(\ell _f/R\).

Fig. 8
figure 8

Left panel: Values of \(\lambda R\) (red) obtained by inverting numerically Eq. (6) for different values of \(\ell _f/R\). The two asymptotic curves are also displayed: in blue, Eq. (A.12) for \(\ell _f/R\ll 1\), and in black, Eq. (A.13) for the long jump limit \(\ell _f/R\gg 1\). Right panel: Numerical estimates of \(1-L_z/L\) for different values of \(\ell _f/R\) (red dot), compared with the curve \(1-\lambda \ell _f/2\) (in black) (Color figure online)

Monte Carlo Simulation of Conditioned Trajectories

As the transition probability (5) is invariant under translation along the axis z, the distribution of the walker positions in the transverse direction reaches a stationary state:

$$\begin{aligned} P_{st}(\rho , \theta )=\frac{J_0^2(\lambda \rho )}{\pi \,R^2\,[J_0^2(\lambda R)+J_1^2(\lambda R)]}\,, \end{aligned}$$
(A.14)

that verifies, for all \(\rho <R\),

$$\begin{aligned} \int _0^R \rho ^\prime \mathrm{d}\rho ^\prime \int _0^{2\pi }\mathrm{d}\theta ^\prime \, q(\rho , \theta \,|\,\rho ^\prime , \theta ^\prime )\,P_{st}(\rho ^\prime , \theta ^\prime ) = P_{st}(\rho , \theta )\,, \end{aligned}$$

where

$$\begin{aligned} \int _0^{2\pi }\mathrm{d}\theta ^\prime&q(\rho , \theta \,|\,\rho ^\prime , \theta ^\prime ) =\quad \int _{-\infty }^{+\infty } \mathrm{d}z \int _0^{2\pi }\mathrm{d}\theta ^\prime \,q(\rho , \theta , z\,|\,\rho ', \theta ', 0)\,,\\&= m^2 \, \frac{J_0(\lambda \rho )}{J_0(\lambda \rho ')} {\left\{ \begin{array}{ll} I_0(c_\lambda \rho ')\,K_0(c_\lambda \rho ) \qquad \mathrm{if }\;\rho >\rho '\\ I_0(c_\lambda \rho )\,K_0(c_\lambda \rho ') \qquad \mathrm{else}. \end{array}\right. } \end{aligned}$$

Starting from steady state (A.14) in the transverse direction of the channel, we then generate conditioned trajectories using a direct Monte Carlo method with the jump process (5). To sample jumps from (5), we use the acceptance-rejection method with the instrumental pdf

$$\begin{aligned} f(\mathbf {r}_1|\mathbf {r}_0) = \frac{m^2 \,e^{-m\,||\mathbf {r}_1-\mathbf {r}_0||}}{4\pi \,||\mathbf {r}_1-\mathbf {r}_0||\, C(\mathbf {r}_0)} \,e^{\lambda (z_1-z_0)}\,\mathbb {I}_{\rho _1<R}\,, \end{aligned}$$
(A.15)

where \(C(\mathbf {r}_0)=m^2 \left[ 1-c_{\lambda }R\;I_0(c_{\lambda }\rho _0)\;K_1(c_{\lambda }R)\right] /c_{\lambda }^2\). The cumulative distribution function (cdf) of Eq. (A.14) can be exactly computed thus sampling \(\rho \) does not represent a computational bottleneck. The cdf for (A.15) cannot be expressed in a closed form but this pdf is indeed simpler to sample due to the absence of the Bessel functions of the first kind. For all \(\mathbf {r}_0\) and \(\mathbf {r}_1\) in the cylinder, \(q(\mathbf {r}_1\,|\,\mathbf {r}_0)\le k\,f(\mathbf {r}_1\,|\,\mathbf {r}_0)\), where \(k = C(\rho _0)/J_0(\lambda \rho _0)\), which sets the rejection threshold to

$$\begin{aligned} 0<\frac{q(\mathbf {r}_1\,|\,\mathbf {r}_0)}{k\,f(\mathbf {r}_1\,|\,\mathbf {r}_0)} = J_0(\lambda \rho _1)\le 1. \end{aligned}$$
(A.16)

Observe that this threshold decreases when the walk gets closer to the boundaries (\(\rho _1\rightarrow R\)) and closer to the diffusion limit (\(\lambda R\rightarrow z_{0,1}\)). It finally remains to show how to sample from \(f(\mathbf {r}_1\,|\,\mathbf {r}_0)\). Using the change of variables

$$\begin{aligned} {\left\{ \begin{array}{ll} \;\;\ell = ||\mathbf {r}_1-\mathbf {r}_0||\;,\\ \;\;\xi = \cos \nu = \displaystyle \frac{z_1-z_0}{\ell }\;\in [-1,1]\;,\\ \;\;\tan \varphi = \displaystyle \frac{y_1-y_0}{x_1-x_0}\,,\;\;\varphi \in [-\pi ,\pi ]\,, \end{array}\right. } \end{aligned}$$
(A.17)

we can rewrite the pdf (A.15) as

$$\begin{aligned} f(\mathbf {r}_1|\mathbf {r}_0)\,\mathrm{d}^3\mathbf {r}_1&= \mathbb {I}_{\ell <\ell ^*}\,\frac{m^2 \,e^{-m\,\ell + \lambda \,\ell \,\xi }}{4\pi \, C(\rho _0)} \;\ell \,\mathrm{d}\ell \;\mathrm{d}\xi \;\mathrm{d}\varphi \;, \end{aligned}$$
(A.18)

where \(\ell ^*(\mathbf {r}_0, \xi , \varphi )\) is the maximum length that a walker starting from \(\mathbf {r}_0\) can travel within the cylinder in the direction given by \((\xi , \varphi )\): \(\ell ^*= b(\mathbf {r}_0, \varphi )/\sqrt{1-\xi ^2}\), with \(b(\mathbf {r}_0, \varphi )=\sqrt{R^2 - \rho _0^2\sin ^2(\varphi -\theta _0)} -\rho _0\cos (\varphi -\theta _0)\). The joint probability density can then be decomposed into three probability densities, one for each variable:

$$\begin{aligned} f(\ell ,\, \xi ,\, \varphi \,|\mathbf {r}_0)\,\ell ^2&= f(\ell \,|\, \xi ,\, \varphi ,\,\mathbf {r}_0) f(\xi \,|\, \varphi ,\,\mathbf {r}_0) f(\varphi \,|\,\mathbf {r}_0) \end{aligned}$$

where

$$\begin{aligned} {\left\{ \begin{array}{ll} \, f(\varphi \,|\,\mathbf {r}_0) &{}=\, \int _0^{+\infty } \ell ^2 \mathrm{d}\ell \int _{-1}^{1}\mathrm{d}\xi \,f(\ell ,\,\xi ,\,\varphi \,|\mathbf {r}_0)\\ \, f(\xi \,|\,\varphi ,\,\mathbf {r}_0) &{}=\, \displaystyle \frac{\int _0^{+\infty } \ell ^2 \mathrm{d}\ell \; f(\ell ,\, \xi ,\, \varphi \,|\mathbf {r}_0)}{f(\varphi \,|\mathbf {r}_0)}\\ \, f(\ell \,|\, \xi ,\, \varphi ,\,\mathbf {r}_0) &{}=\, \displaystyle \frac{\ell ^2\,f(\ell , \xi , \varphi \,|\mathbf {r}_0)}{f(\xi \,|\,\varphi , \mathbf {r}_0)\,f(\varphi \,|\mathbf {r}_0)}\,. \end{array}\right. } \end{aligned}$$

Starting from \(\mathbf {r}_0\), we thus sample first the angle \(\varphi \) from

$$\begin{aligned} f(\varphi )= \frac{m^2}{2\pi \, c_{\lambda }^2 \,C(\rho _0)} \left\{ 1 - c_{\lambda }\,b(\varphi )\,K_1[ c_{\lambda }b(\varphi )] \right\} \,, \end{aligned}$$
(A.19)

then, given the angle \(\varphi \), we then obtain \(\xi \) from the pdf

$$\begin{aligned} f(\xi \,|\,\varphi ) =\frac{m^2}{4\pi \,C(\rho _0)\,f(\varphi )}\, \frac{1-e^{-(m-\lambda \xi )\ell ^*} \left[ 1+(m-\lambda \xi )\ell ^*\right] }{(m-\lambda \xi )^2}. \end{aligned}$$

Finally, the jump length \(\ell \) is sampled directly from

$$\begin{aligned} f(\ell \,|\,\xi ,\varphi ) = \frac{(m-\lambda \,\xi )^2 \,\;\;\ell \,e^{-(m-\lambda \xi )\ell } \;\mathbb {I}_{\ell \le \ell ^*} }{1-e^{-(m-\lambda \xi )\ell ^*} \left[ 1+(m-\lambda \xi )\ell ^* \right] } \;, \end{aligned}$$
(A.20)

using the Lambert W function.

Theoretical Analysis of the Polymer Extension \(L_z=\langle z_N-z_0\rangle \)

After relaxation to steady state in the transverse direction (see Appendix 5), the generating function of the jump lengths \(z=(z_{i+1}-z_{i})\) along the axis of the cylinder is given by

$$\begin{aligned}&G(s)=\langle e^{sz}\rangle =\int _{-\infty }^{+\infty } \mathrm{d}z \;e^{sz}\;p(z)\,,\qquad \mathrm{where}\\&p(z) = \int \rho \,\mathrm{d}\rho \,\mathrm{d}\theta \int \rho '\mathrm{d}\rho ' \,\mathrm{d}\theta ' \;q(\rho ', \theta ', z\,|\,\rho , \theta , 0)\,P_{st}(\rho , \theta ).\nonumber \end{aligned}$$
(A.21)

Integrating, we obtain

$$\begin{aligned} G(s)&=\frac{m^2}{m^2-s^2-2\lambda s}\, \nonumber \\&\qquad \times \left[ 1 + 2\, \frac{ \left[ \lambda \,J_1 K_0 - c_{\lambda }(s)\, J_0 K_1\right] \; \left[ \lambda \,J_1 I_0 + c_{\lambda }(s)\, J_0 I_1\right] }{(J_0^2+J_1^2)\;(m^2-s^2-2\lambda s)} \right] , \end{aligned}$$
(A.22)

where \(c_{\lambda }(s) = \sqrt{m^2-(\lambda +s)^2}\), \(K_i = K_i[c_{\lambda }(s)\, R]\), \(I_i = I_i[c_{\lambda }(s)\, R]\) and \(J_i = J_i(\lambda R)\). Finally expanding to first order at \(s=0\) leads to the expression of the mean jump length along the z-axis, \(\ell _z = \langle z \rangle = G^\prime (s)|_{s=0}\):

$$\begin{aligned} \ell _z = \frac{\lambda \ell _f^{\,2}}{2}\, \bigg [1 + g\left( \frac{\ell _f}{2R}\right) \bigg ]\,, \end{aligned}$$
(A.23)

where g is a positive and increasing function of \(\ell _f/R\) that vanishes as \(\ell _f/R\) goes to 0:

$$\begin{aligned} g \left( \frac{\ell _f}{2R} \right) = \frac{ \lambda J_1 I_0 + c_{\lambda } J_0 I_1 }{c_{\lambda }\,(J_0^2+J_1^2)}\, [J_0(2 K_1- c_{\lambda } R K_2)+\lambda R J_1 K_1] \end{aligned}$$
(A.24)

with \(J_i = J_i(\lambda R)\), \(K_i = K_i(c_{\lambda } R)\) and \(I_i = I_i(c_{\lambda } R)\). We recall that both \(\lambda R\) and \(c_\lambda R\) are functions of \(mR=2R/\ell _f\). In the diffusive limit \(\ell _f\ll 2R\), \(\lambda \ell _f\) behaves as \(O(\ell _f/R)\) (see Eq. (A.12)), and expanding (A.23) to first order thus yields the asymptotic behavior:

$$\begin{aligned} \ell _z = \ell _f \left[ \frac{\lambda \ell _f}{2} + o\left( \frac{\ell _f}{2R}\right) \right] \sim z_{0,1}\,\frac{\ell _f^2}{2R}\,. \end{aligned}$$
(A.25)

This result is in agreement with the direct derivation for the diffusive case, where we found the drift \(2D \lambda \) along the cylinder axis (see Appendix A.9). Since the process is Markovian and is started from steady state, the mean extension of the polymer can be decomposed as \(L_z=N\ell _z\), and the total length of the polymer as \(L=N \ell _c\) (see main text). Moreover, in the diffusive limit, \(\ell _c\sim \ell _f\), so that Eq. (A.25) becomes

$$\begin{aligned} \frac{L_z}{L} = \frac{\ell _z}{\ell _c} \sim \lambda \,\frac{\ell _f}{2} \qquad \mathrm{with}\;\;\lambda \sim \frac{z_{0,1}}{R}\,, \end{aligned}$$
(A.26)

which varies linearly with \(\ell _f/R\) (see left panel of Fig. 4). Note that, in the long-jump limit \(mR \ll 1\), the asymptotic expansion of Eq. (A.24) is

$$\begin{aligned} g(mR) = \frac{(mR)^4}{4} \exp \bigg [\frac{4}{(mR)^2}\bigg ]-1+O(mR)^2\;. \end{aligned}$$
(A.27)
Fig. 9
figure 9

Evolution of \(\langle L_{\perp } \rangle /R\) as a function of the rescaled variable \(\lambda \,\ell _f L/(2R)\) in log-log scale. Each colored curve is obtained from \(10^4\) realizations of the walk with a fixed value of the parameter \(\ell _f\) (see scale on the right), varying the total length of the polymer (from \(N=1\) to \(N=10^4\) jumps). Observe that the rescaled curves do not collapse for values of \(\langle L_{\perp } \rangle /R\) close to 1 (Color figure online)

Numerical Analysis

Polymer extension \(L_z\)—Perhaps surprisingly, we observe from the numerical simulations that Eq. (A.26) extends to any value of \(\ell _f\),

$$\begin{aligned} \mathrm{for}\;\mathrm{any}\;\ell _f,\qquad \frac{L_z}{L} = \frac{\ell _z}{\ell _c} \simeq \lambda \,\frac{\ell _f}{2}\,, \end{aligned}$$
(A.28)

where \(\lambda \) is now given by Eq. (6), as shown in the Right panel of Fig. 8 where Eq. (A.28) matches almost perfectly the numerical data. In the long-jump regime \(\ell _f\gg R\), using the expansion (A.13) for \(\lambda R\), we obtain

$$\begin{aligned} \mathrm{for}\;\ell _f \gg R, \qquad \frac{L_z}{L} \sim 1-\frac{1}{2}\left[ \left( \frac{\ell _f}{2R}\right) e^{-2\textstyle \left( \frac{\ell _f}{2R}\right) ^2} \right] ^{2}. \end{aligned}$$
(A.29)

Mean jump length under confinement \(\ell _c\)—Reformulating Eq. (A.28) with Eq. (A.23) we can write:

$$\begin{aligned} \mathrm{for}\;\mathrm{any}\;\ell _f,\qquad \ell _c\simeq \ell _f\, \bigg [1 + g\left( \frac{\ell _f}{2R}\right) \bigg ]\,,&\end{aligned}$$
(A.30)

which stays consistent with the numerical data (see Fig. 4). In the diffusive limit we recover that \(\ell _c\sim \ell _f\), and, in the long-jump limit, using Eq. (A.27), we can note the extremely rapid growth of \(\ell _c\) as \(\ell _f/R\) increases:

$$\begin{aligned} \mathrm{for}\;\;\ell _f \gg R, \qquad \;\; \frac{\ell _c}{2R} \sim \frac{1}{4}\, \left( \frac{2R}{\ell _f}\right) ^{3}\, e^{\, 4 \left( \frac{\ell _f}{2R}\right) ^{2}}. \end{aligned}$$
(A.31)

End-to-end distance \(R_{ee}=\sqrt{\langle ||\mathbf {r}_n-\mathbf {r}_0||^2\rangle }\)—In Fig. 3, each colored curve (fixed value of \(\ell _f/R\)) displays two distinct regimes: \(R_{ee}\propto \sqrt{L}\) for \(R_{ee}\ll R\) and \(R_{ee}\propto L\) for \(R_{ee}\gg R\). For polymer such that \(R_{ee} \ll R\), the polymer behavior can be modeled by a Brownian walker under confinement, which yields,

$$\begin{aligned} R_{ee}^2= 6Dt+(2\lambda D t)^2\,, \end{aligned}$$
(A.32)

with \(t=N\tau =\ell _f L/4\) and where the second term comes from the drift along the z-axis resulting from the confinement (see Appendix A.9). Replacing the value of t, we observe that this second term is negligible with respect to the first one, so that \(R_{ee}\) evolves as \(\sqrt{6Dt}\):

$$\begin{aligned} \mathrm{for}\;R_{ee} \ll R, \qquad \;\; \frac{R_{ee}}{R}\sim \sqrt{\,3\;\frac{\ell _f}{2R}\;\frac{L}{R}} \end{aligned}$$
(A.33)

the effect of the confinement on \(R_{ee}\) is not visible in this regime. For long polymers \(R_{ee} \gg R\), we observe that \(R_{ee}\) can be rescaled using \(L\rightarrow \lambda \,\ell _f L/2\) (see Fig. 3). Note that this rescaling is valid only after a large number of jumps, \(N\gg 1\), and is not exact. Indeed, by definition we can write \(R_{ee}=\sqrt{ \langle L_{\perp } ^2 \rangle + \langle \,(z_N-z_0)^2 \rangle }\) where \(L_{\perp }\) in defined in the transverse direction of the cylinder. The rescaling does not apply to \(\langle L_{\perp }^2 \rangle \) in the long-polymer regime (see Fig. 9). However this is not visible on \(R_{ee}\), as, for long polymer (\(R_{ee}\gg R\)), \(\langle \,(z_N-z_0)^2 \rangle \gg \langle L_{\perp } ^2 \rangle \), and therefore \(R_{ee}\sim \sqrt{\langle \,(z_N-z_0)^2 \rangle }\) that rescales for large N.

Fig. 10
figure 10

Summary of the results found analytically and numerically, for \(L_z\) and \(\ell _c\) in the regimes \(R\ll \ell _f\) and \(R\gg \ell _f\), and for \(R_{ee}\) in the regimes \(R\ll R_{ee}\) and \(R\gg R_{ee}\). We took the notations \(\tilde{\ell _f}=\ell _f/(2R)\) and \(\tilde{\ell _c}=\ell _c/(2R)\). General expressions for \(L_z/L\) and \(\tilde{\ell _c}\), found valid in any regime, are given, respectively, in Eq. (A.28) and Eq. (A.30)

Now keeping the number of jumps N fixed and varying the effective channel size (see black dots in Fig. 3), we observe three main regimes. They result from the overlap of the two transitions previously described, for \(R_{ee}\) and \(L_z\), and are summarized in Fig. 8.

Brownian Motion Conditioned to Stay Inside a Cylinder

In the continuum (\(l_f/R \rightarrow 0\)) the jump process becomes a controlled Brownian motion for which an analytical description is affordable. The effect of confining a Wiener process in the cylindrical channel \(\mathcal {C}\) is subsumed by an additional drift term [27], \(u(\mathbf {r})\), called control drift (Fig. 10). The Langevin equation for the walker thus reads

$$\begin{aligned}&\dot{\mathbf {r}}(t)=\mathbf {u}(\mathbf {r}) + \sqrt{2 D}\,\varvec{\eta }_t\;, \end{aligned}$$
(A.34)

where each \(\eta ^i_t\) is an independent white noise. The behaviour of the conditioned Brownian process then corresponds to the optimal (stationary) trajectories of this controlled walker: we look for the optimal control drift using the Hamilton-Jacobi-Bellman equation with a cost that takes into account the boundaries (see [8]). We find that the drift \(\mathbf {u}(\mathbf {r})\) takes the form:

$$\begin{aligned} \mathbf u (\rho )&= 2 D \lambda \, \mathbf e _z - 2D \lambda \,\frac{J_1(\lambda \,\rho )}{J_0(\lambda \,\rho )}\, \mathbf e _\rho \;, \end{aligned}$$
(A.35)

where \(\lambda = z_{0,1}/R\). As a consequence, the mean length travelled by the conditioned Brownian walker in the direction of the z-axis during a time \(\tau \) is

$$\begin{aligned} \ell _z=\langle z \rangle =2D\lambda \,\tau \,. \end{aligned}$$
(A.36)

For the process (A.7), where \(\tau D=\ell _f^{\,2}/4\), we thus expected to recover, in the diffusive limit, that \(\ell _z=\lambda \,\ell _f^{\,2}/2\) (Fig. 10). For the same reason, we find that the mean-square distance travelled in the direction of the z-axis during a time t is given by:

$$\begin{aligned} \langle \, z^2(t)\,\rangle&= \sigma (t)^2 + \langle z(t)\rangle ^2= 2D\,t + (2D\,\lambda \,t)^2\,. \end{aligned}$$
(A.37)

The Limit \(H/R \rightarrow \infty \) for the Conditioned Brownian Motion

The Laplace equation in cylindrical coordinates is

$$\begin{aligned} \varvec{\nabla }^2 Z(\rho ,\,\theta ,\,z) = \frac{1}{\rho }\partial _\rho \left( \rho \,\partial \rho Z \right) + \frac{1}{\rho ^2} \partial _\theta ^2 Z + \partial _z^2 Z = 0 \end{aligned}$$

The cylinder has a radius R and in the z direction it extends from \(-H\) to H. We impose the following boundary conditions for the Laplace equation:

$$\begin{aligned}&Z(R,\,\theta ,\,z) = 0 = Z(\rho ,\,\theta ,\,-H) \\[1ex]&Z(\rho ,\,\theta ,\,H) = 1. \end{aligned}$$

The equation is separable and, looking for a solution of the kind \(Z(\rho ,\,\theta ,\,z) = P(\rho )\,\varTheta (\theta )\,\zeta (z)\), it can be written as the following equivalent system of coupled ordinary differential equation:

$$\begin{aligned}&\zeta ''(z) = \lambda ^2\,\zeta (z) ,\\[1ex]&\varTheta ''(\theta ) = - \mu ^2\,\varTheta (\theta ) , \\[1ex]&\rho ^2 P''(\rho ) + \rho P'(\rho ) + (\lambda ^2 \rho ^2 - \mu ^2) P(\rho ) = 0 , \end{aligned}$$

where here \(\lambda \) and \(\mu \) are real parameters. The solution to the equation for \(\zeta \) which satisfies the Dirichlet boundary conditions on the left end of the cylinder is

$$\begin{aligned} \zeta (z) = const \times \sinh [\lambda (z + H)] \end{aligned}$$

The equation for \(\varTheta \) satisfying the rotational invariance about the longitudinal axis of the cylinder selects the value \(\mu = 0\) and is just a constant:

$$\begin{aligned} \varTheta (\theta ) = const \end{aligned}$$

Finally, the solution for P is the regular Bessel function of first kind of order zero:

$$\begin{aligned} P(\rho ) = const \times J_0(\lambda \,\rho ) \end{aligned}$$

the allowed values of \(\lambda \) are all and only those for which \(P(R) = 0\), so \(\lambda _n = z_{0,n}/R\), where we denote by \(z_{0,n}\) the n-th zero of \(J_0(x)\) (Fig. 11).

Therefore, the solution of the Laplace equation in the cylindrical geometry specified above is, dropping the \(\theta \) dependence,

$$\begin{aligned} Z(\rho ,\,z) = \sum _{n=1}^\infty c_n\,\sinh [z_{0,n}\,(z + H)/R]\,J_0(z_{0,n} \rho /R) \end{aligned}$$

The vanishing conditions at \(\rho = R\) and \(z = -H\) is already implemented in the solution, while the boundary condition \(Z|_{z=H} = 1\) fixes the coefficients \(c_n\) as the solution of

$$\begin{aligned} \sum _{n=1}^\infty \tilde{c}_n\,J_0(z_{0,n} x) \equiv \sum _{n=1}^\infty \tilde{c}_n\,J_{0,n}(x) = 1 \qquad \forall \; x = \frac{\rho }{R}\in [0, 1) \end{aligned}$$

where \(\tilde{c}_n = c_n\,\sinh [2\,a\,z_{0,n}/R]\).

The set \(\{ J_{0,n}(x)\}_{n=1}^\infty \) is a basis of the set of function in the interval [0, 1) and they are mutually orthogonal therein with respect to the measure \(d\mu (x) = x\, dx\) Footnote 1:

$$\begin{aligned} \int _0^1 dx\, x\, J_{0,n}(x)\,J_{0,m}(x) = \frac{J_1(z_{0,n})^2}{2}\,\delta _{m,n} \end{aligned}$$

The coefficients \(\tilde{c}_n\) are therefore found to be the (properly normalized) inner products between the function \(f(x) = 1\) and \(J_{0,n}(x)\) within [0, 1):

$$\begin{aligned} \tilde{c}_n = \frac{2}{J_1(z_{0,n})^2}\,\int _0^1 dx\, x\,J_{0,n}(x) = \frac{2}{J_1(z_{0,n})\,z_{0,n}} \end{aligned}$$

so that the full solution Z of the Laplace equation is

$$\begin{aligned} Z(\rho ,\,z) = \sum _{n=1}^\infty \frac{2}{J_1(z_{0,n})\,z_{0,n}} \frac{\sinh [z_{0,n}\,(z + H)/R]}{\sinh [2 a\,z_{0,n}\,/R]}\,J_0(z_{0,n} \rho /R). \end{aligned}$$
Fig. 11
figure 11

The ratio between the coefficients of the first subleading term and the leading one against the length of the cylinder \(L=2H\), in logarithmic scale: the suppression of the subleading terms is exponential in L

In the limit \(H/R \rightarrow \infty \) (infinite cylinder) with finite z, only the first term of the expansion can be retained:

$$\begin{aligned} Z(\rho ,\,z) \propto \exp (z_{0,1}\,z/R)\,J_0(z_{0,1}\,\rho /R) \end{aligned}$$

The drift in the effective Langevin dynamics of the conditioned Brownian motion is then

$$\begin{aligned} \mathbf u _*(\rho ,\,z) = 2\,D\,\varvec{\nabla }\log Z(\rho ,\,z) = 2 D \lambda \, \mathbf e _z - 2D \lambda \,\frac{J_1(z_{0,1}\rho /R)}{J_0(z_{0,1}\rho /R)}\, \mathbf e _\rho , \end{aligned}$$

where \(\lambda = z_{0,1}/R\) (Fig. 12).

Fig. 12
figure 12

Equation 2 is solved in the limit of an infinite cylinder. The ensemble we consider here can be thought as consisting of very long chains whose two termini (at \(i \rightarrow \pm \infty \)) are tethered at the opposite ends of the cylinder. We look at the statistics of a subportion comprised between two tagged beads (\(i=0\) and \(i=N\))

Density Fluctuations

To study the density of beads along the cylinder, we focus on the evolution of the driven Brownian walker (see Appendix A.9) along the z-axis, described by the stochastic process:

$$\begin{aligned} \mathrm{d}z_t = 2D\lambda \,\mathrm{d}t + \sqrt{2D}\,\mathrm{d}W_t \end{aligned}$$
(A.38)

where \(\mathrm{d}W_t\) is the standard Wiener process. As described in Appendix A.9 the first term is the drift along the z-axis due to confinement. Consider now the interval \([0,\,\varDelta ]\) along the z-axis, we define the residence time of the walker therein as

$$\begin{aligned} \phi _\varDelta = \int _0^\infty \mathrm{d}t\,\mathbb {I}_{\varDelta }(z_t)\,, \end{aligned}$$
(A.39)

where \(\mathbb {I}_\varDelta \) is the characteristic function of \([0,\,\varDelta ]\), equal to 1 within the interval and 0 otherwise. In general, \(\phi _\varDelta \) is a random variable, whose statistics depends on the initial conditions of the process. Its moment generating function is defined as

$$\begin{aligned} G_\varDelta (s,\,z_0) = \Big \langle e^{- s \phi _\varDelta } \Big | \, z_0 \Big \rangle \end{aligned}$$
(A.40)

and satisfies the stationary Feynman–Kac equation

$$\begin{aligned} 2D\lambda \,\frac{\partial G_\varDelta }{\partial z_0} + D\,\frac{\partial ^2 G_\varDelta }{\partial z_0^2} = s\;\mathbb {I}_\varDelta (z_0)\;. \end{aligned}$$
(A.41)

In Eq. (A.40), the average is taken with respect to the measure of the paths generated by the dynamics in Eq. (A.38). The drift in Eq. (A.38), that drives the process towards increasing values of \(z_t\), fixes the boundary conditions of \(G_\varDelta (s,\,z_0)\):

$$\begin{aligned} {\left\{ \begin{array}{ll} &{}G_\varDelta (s,\,z_0) \underset{z_0\rightarrow +\infty }{\longrightarrow } 1\,, \qquad \mathrm{as}\;\;\phi _\varDelta \rightarrow 0\\ &{}G_\varDelta (s,\,z_0) \underset{z_0\rightarrow -\infty }{\longrightarrow } \mathrm{const}(s)\,. \end{array}\right. } \end{aligned}$$
(A.42)

The general solution of Eq. (A.41) then reads

$$\begin{aligned} G_\varDelta (s,\,z_0) = {\left\{ \begin{array}{ll} A_l\,e^{-2\lambda \,z_0} + B_l &{}\mathrm{for}\;z_0 < 0 \\[1ex] e^{-\lambda z_0}( A_+ e^{\alpha \,x_0} - A_- e^{-\alpha \,z_0}) \,&{}\mathrm{for}\;z_0\in [0,\varDelta ]\\[1ex] A_r\,e^{-2\lambda \,z_0} + B_r &{}\mathrm{for}\;z_0 > \varDelta \end{array}\right. } \end{aligned}$$

where \(\alpha = \sqrt{\lambda ^2 + s/D}\) and the \(A_i\) and \(B_i\) are constants with respect to \(z_0\). The conditions of Eq. (A.42) then set

$$\begin{aligned} A_l = 0 \qquad \mathrm{and } \qquad B_r = 1\;. \end{aligned}$$
(A.43)

The four other constants are uniquely determined by imposing continuity and differentiability of \(G_\varDelta \) at \(z_0=0\) and \(z_0=\varDelta \). Note that, for \(z_0<0\), \(G_\varDelta (s,\,z_0)\) doesn’t depend on \(z_0\), and thus, the statistics of \(\phi _\varDelta \) are independent of the specific value of \(z_0\).

Fig. 13
figure 13

Probability density functions of the rescaled residence time \(\hat{\phi }_\varDelta = (\phi _\varDelta -\langle \phi _\varDelta \rangle )/\sigma _{\phi _\varDelta }\) in the homogeneous case (black curve) and for decreasing values of \(\varDelta \) (colored curves) in the case \(\ell _f/R = 4.511 \times 10^{-2}\). As discussed in the main text the peak and the tail of each curve highlight inhomogeneities in the system. The right tail indicates the presence of regions with higher density of points and the peak at negative values stems from the presence of regions with lower density of points. The theoretical result (dashed lines) is also shown to be in extremely good agreement with data (Color figure online)

In our estimates of \(\phi _\varDelta \), we are interested only in the case \(z_0<0\), since the initial condition of the process is always to the left of the interval \([0,\,\varDelta ]\). Therefore, the moment generating function of \(\phi _\varDelta \) is given by the amplitude \(B_l\):

$$\begin{aligned} G_\varDelta (s,\,z_0<0) = \frac{4 \lambda \,\alpha \, e^{\varDelta \left( \alpha +\lambda \right) }}{ \left( \alpha +\lambda \right) ^2 e^{2 \varDelta \alpha }-\left( \lambda -\alpha \right) ^2 }\;, \end{aligned}$$
(A.44)

where we recall that \(\alpha (s) = \sqrt{\lambda ^2 + s/D}\). Note that \(G_\varDelta \) can be written in the scaling form \(G_\varDelta (s) = \tilde{g}(\varDelta ^2 s / D,\, \varDelta \,\lambda )\), where \(\tilde{g}\) is

$$\begin{aligned} \tilde{g}(u,\,v) = \frac{4 v \sqrt{u+v ^2}\, e^{\varDelta \left( \sqrt{u+v^2}+v\right) }}{\left( \sqrt{u+v^2}+v\right) ^2 e^{2\sqrt{u+v^2}}-\left( \lambda -\sqrt{u+v^2}\right) ^2}\,. \end{aligned}$$

In particular, the diffusion constant D can be absorbed in the scaling variable u. Hence it follows that the probability density of the residence time \(\phi _\varDelta \), denoted \(F_\varDelta (\phi _\varDelta )\), is given by the inverse Laplace transform

$$\begin{aligned} F_\varDelta (\phi _\varDelta )&= \frac{1}{2\pi \mathrm{i}} \int _\gamma \mathrm{d}s\,e^{s\,\phi _\varDelta }\,G_\varDelta (s)\,, \nonumber \\&= \frac{D}{\varDelta ^2}\,\tilde{f}\left( \frac{D\,\phi _\varDelta }{\varDelta ^2},\,\varDelta \lambda \right) \;, \end{aligned}$$
(A.45)

where \(\tilde{f}\) is the inverse Laplace transform of \(\tilde{g}\) with respect to its first variable. The results are shown in Fig. 13.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Adorisio, M., Pezzotta, A., de Mulatier, C. et al. Exact and Efficient Sampling of Conditioned Walks. J Stat Phys 170, 79–100 (2018). https://doi.org/10.1007/s10955-017-1911-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10955-017-1911-y

Keywords

Navigation