# Computing inverses in Reversible-Jump Metropolis Light Transport

Say we are sampling a path $$\rm x=(\rm x_0,\ldots,\rm x_{n-1})$$ of length $$n-1$$ using bidirectional path tracing. Let $$p_s$$ denote the area product density corresponding to the used connection strategy concatenating a light subpath $$\rm q_0,\ldots,\rm q_{s-1}$$ and a reversed camera subpath $$\rm p_{t-1},\ldots,\rm p_0$$ so that $$\rm x=(\rm q_0,\ldots,\rm q_{s-1},\rm p_{t-1},\ldots,\rm p_0)$$.

Let $$\overrightarrow p(\rm x_i)$$ and $$\overleftarrow p(\rm x_i)$$ denote the importance and radiance transport area density of $$\rm x_i$$, respectively, so that $$p_s(\rm x)=\overrightarrow p(\rm x_0)\cdots\overrightarrow p(\rm x_{s-1})\overleftarrow p(\rm x_s)\cdots\overleftarrow p(\rm x_{n-1}).\tag1$$

If we are interested in the area product densities corresponding to other connection strategies that could have produced this path $$\rm x$$, we can quite easily do so using $$(1)$$, as described in the pbr-book: http://www.pbr-book.org/3ed-2018/Light_Transport_III_Bidirectional_Methods/Bidirectional_Path_Tracing.html#MultipleImportanceSampling.

Now consider Multiplex Metropolis Light Transport. Path sampling using connection strategy $$(s,t)$$ is performed by mapping a primary state space sample to the path space by a transformation$$^1$$ $$P_s^{-1}$$ as described in Section 2.4 of the MMLT paper: https://www.ci.i.u-tokyo.ac.jp/~hachisuka/mmlt.pdf.

Say $$\rm x$$ was produced by the primary state space sample $$u$$, i.e. $$x=P_s^{-1}(u)$$. How can we find a primary state space sample $$v$$ with $$x=P_i^{-1}(v)$$ (the transformation corresponding to the connection strategy using a light subpath with $$i$$ vertices)?

I guess we can do something similar as described above, i.e. it should be sufficient to consider the primary state space dimensions corresponding to the connecting vertices (and leaving the other dimensions unchanged).

I would like to implement this in the PBRT code.

Remark: Section 6 of the Reversible-Jump Metropolis Light Transport paper is related: https://cs.dartmouth.edu/~wjarosz/publications/bitterli18reversible.pdf.

$$^1$$ To be precis, let $$\lambda$$ denote the Lebesgue measure on $$\mathcal B([0,1))$$ and $$\mu$$ denote the area product measure on the space of paths of length $$n-1$$. The primary sample state space is $$[0,1)^d$$, where $$d\in\mathbb N$$ is sufficiently large and the pushforward measure $$\lambda^{\otimes d}\circ P_s$$ is precisely the probability distribution $$p_s\mu$$.