In Stim, is it possible to compute the inner product $\langle\phi|\psi\rangle$ of two stabiliser states $|\phi\rangle$ and $|\psi\rangle$? It seems like this should be possible, since an algorithm to do this using the tableaus of these states is presented at the end of section III of Ref [1], but I have not been able to find a way in the Stim documentation.
Also, is it possible to compute the inner product/partial contraction over a restricted subset of qubits? For example, for a system with four qubits and states $|\phi\rangle=\frac{1}{\sqrt{2}}(\mathrm{i}|0\rangle_1|0\rangle_2+|1\rangle_1|0\rangle_2)$ and $|\psi\rangle=|0\rangle_1|0\rangle_2|1\rangle_3|0\rangle_4$ the inner product would be $$ \langle\phi|\psi\rangle=\frac{1}{\sqrt{2}}(-\mathrm{i}\langle0|_1\langle 0|_2+\langle 1|_1\langle 0|_2)|0\rangle_1|0\rangle_2|1\rangle_3|0\rangle_4 = -\frac{\mathrm{i}}{\sqrt{2}} |1\rangle_3|0\rangle_4, $$ which lives in the Hilbert space of dimension $2^2$ spanned by the third and fourth qubits. (Another way to phrase this would be as the action of the operator $\mathcal{O}=\langle\phi|\otimes \text{Id}$ on $|\psi\rangle$, where $\text{Id}$ is the identity operator on qubits 3 and 4.)
[1] Improved Simulation of Stabilizer Circuits, S. Aaronson, D. Gottesman, Phys. Rev. A 70, 052328 (2004)