# How to take partial trace of a $n - 1$ qubit subsystem from a $n$ qubit system

I would like to calculate the expression $$\text{Tr}_2\left\{R^z \sigma\right\}\,,$$ where $$\sigma = \rho \otimes |0\rangle \langle0|^{{\otimes}(n-1)}\,.$$ Here $$R = \sum{\theta_m}G_m\,,$$ where $$\theta_m \in \mathbb{R}$$ and $$G_m \in \left\{i( \sigma_1, \sigma_2, \sigma_3 \cdots \sigma_n) \right\}$$.

Here, partial trace means that we need to trace out that subsystem of ancilla after solving. Can anybody show a way and here $$z > 1$$ .

• – glS
Commented Jan 29 at 13:14

While the comment of glS contains the mathematical tools needed here, this particular problem features a bit more structure. For simplicity I will treat the case $$n=2$$ but all that follows does generalize to more qubits.
First, a basic observation; because $$\sigma$$ is a product state the partial trace in question is itself a product: \begin{align*} {\rm tr}_2(R^z\sigma)&={\rm tr}_2(R^z(\rho\otimes|0\rangle\langle 0|))\\ &={\rm tr}_2(R^z(\sigma_0\otimes|0\rangle\langle 0|)(\rho\otimes\sigma_0))\\ &={\rm tr}_2(R^z(\sigma_0\otimes|0\rangle\langle 0|))\,\rho \end{align*} The last step readily follows, for example, from the trace duality of the partial trace. This reduces our problem to computing \begin{align*} {\rm tr}_2(R^z(\sigma_0\otimes|0\rangle\langle 0|))&= \sum_{a_1,\ldots,a_z}\sum_{b_1,\ldots,b_z}\theta_{a_1b_1}\cdots\theta_{a_zb_z}{\rm tr}_2\big(\big( \sigma_{a_1}\ldots\sigma_{a_z}\otimes \sigma_{b_1}\ldots\sigma_{b_z} \big)(\sigma_0\otimes|0\rangle\langle 0|) \big) \\ &= \sum_{a_1,\ldots,a_z}\sum_{b_1,\ldots,b_z}\theta_{a_1b_1}\cdots\theta_{a_zb_z}\sigma_{a_1}\ldots\sigma_{a_z}\langle 0|\sigma_{b_1}\ldots\sigma_{b_z}|0\rangle \end{align*} One can expand this expression further by inserting an "artificial" identity $$\sigma_0=|0\rangle\langle 0|+|1\rangle\langle 1|$$ in-between each $$\sigma_{b_j}$$ and $$\sigma_{b_{j+1}}$$. Using the short hand $$\prod_jf(j):=f(1)f(2)\ldots$$ for the product this allows us to re-write our expression as \begin{align*} {\rm tr}_2(R^z(\sigma_0\otimes|0\rangle\langle 0|))&=\sum_{a_1,\ldots,a_z}\sum_{b_1,\ldots,b_z}\Big(\prod_{j=1}^z\theta_{a_jb_j}\sigma_{a_j}\Big)\Big\langle0\Big|\prod_{j=1}^z\Big(\sigma_{b_j}\Big(\sum_{c_j=0}^1|c_j\rangle\langle c_j|\Big)\Big)\Big|0\Big\rangle\\ &= \sum_{c_1,\ldots,c_z}\prod_{j=1}^z\Big(\sum_{a_j,b_j}\theta_{a_jb_j}\sigma_{a_j}\langle c_{j-1}|\sigma_{b_j}|c_j\rangle \Big) \end{align*} which---because $$\sum_{a,b}\theta_{ab}\sigma_{a}\langle x|\sigma_{b}|y\rangle=\sum_{a,b}\theta_{ab}{\rm tr}_2(\sigma_a\otimes\sigma_b|y\rangle\langle x|))={\rm tr}_2(R(\sigma_0\otimes|y\rangle\langle x|))$$ as is readily verified---lets us arrive at $$\boxed{{\rm tr}_2(R^z(\sigma_0\otimes|0\rangle\langle 0|))=\sum_{c_1,\ldots,c_z}\prod_{j=1}^z{\rm tr}_2(R(\sigma_0\otimes|c_j\rangle\langle c_{j-1}|)) }$$ where $$c_0:=0=:c_{z+1}$$. In other words $${\rm tr}_2(R^z\sigma)$$ can be broken down to a sum of products of simple expressions $${\rm tr}_2(R(\sigma_0\otimes|y\rangle\langle x|))$$.
Alternatively, one could have a more balanced recursive approach where the number of summands does not grow exponentially at the expense of needing more memory. The idea here is to insert an identity not everywhere but only in certain (e.g., in just one) spot. More precisely, given any $$a,b\in\{0,1\}$$ let us define the auxiliary functions $$\xi_{ab}:\mathbb N\to\mathbb C^{2\times 2}$$ via $$\xi_{ab}(z):={\rm tr}_2(R^z(\sigma_0\otimes|a\rangle\langle b|))$$. Much like before one obtains $$\xi_{ab}(z)=\xi_{0b}(p)\xi_{a0}(z-p)+\xi_{1b}(p)\xi_{a1}(z-p)$$ for all $$z\in\mathbb N$$, $$p\in\{0,\ldots,z\}$$, $$a,b\in\{0,1\}$$. By choosing $$p=\lceil\frac{z}2\rceil$$ one sees that computing $${\rm tr}_2(R^{z}(\sigma_0\otimes|0\rangle\langle 0|))$$ this way boils down to (recursively) computing expressions up to only $$\lceil\frac{z}2\rceil$$; for example, if one wants the expression for $$z=8$$ it suffices to know the $$\xi_{ab}(z)$$ for $$z=4$$, which in turn only relies on $$\xi_{ab}(2)$$, etc. Beyond this I do not see any other way to simplify this expression.