# Gaussian Quantum Trajectories for the Variational Simulation of Open Quantum-Optical Systems
## 5 Computational Aspects  
Because of the few simple update rules (five real variables; four if purity relations are used), the computational cost for evolving a single variational trajectory is of the same order as the cost for a single TWA sample (two real variables) given the same set of parameters. For an exact trajectory \(D=2N_{\text{levels}}\) real variables must be evolved for the same single mode, where \(N_{\text{levels}}\) is the amount of occupation levels considered. If the dimension of configuration space \(d\) increases, the dimension of Hilbert space correspondingly grows as \(D\propto e^{d}\), so that large simulations easily become limited by computational load. The dimension of the corresponding phase space on the other hand only grows \(\propto d\), making it far more efficient for large systems. For our variational methods, it is the amount of distinct Gaussian correlation functions that is the relevant quantity of complexity, and this scales in principle as \(\propto d^{2}\). In many large systems, only correlations between neighboring sites are important, and other ones can be neglected. If this is the case, scaling \(\propto d\) is retrieved, as in Gutzwiller- or tensor-network ansatzes. So far, we have only discussed the evolution of a single sample. As Gaussian trajectories, like exact trajectories, have a finite spread in Wigner phase-space, they contain more information than a TWA-sample, which is just a point. Therefore, it can be expected that less samples are required to obtain an accurate description of the ensemble dynamics. We can estimate the difference in statistics as follows: take a trajectory method (exact or variational) of which \(N_{\text{traj}}\) independent trajectories are evolved. For the trajectory methods, the statistical uncertainty [71] is:  
\[\sigma^{2}_{\langle\hat{\text{O}}\rangle,\text{traj}}=\frac{\text{Var}_{2}(\hat {\text{O}})}{N_{\text{traj}}}, \tag{27}\]  
whereas the analogous uncertainty for TWA is:  
\[\sigma^{2}_{\langle\hat{\text{O}}\rangle_{\text{sym}},\text{TWA}} =\frac{\text{Var}_{\text{TWA}}(O_{\text{sym}})}{N_{\text{TWA}}}= \frac{\text{Var}(\hat{\text{O}})}{N_{\text{TWA}}}\] \[=\frac{\text{Var}_{1}(\hat{\text{O}})+\text{Var}_{2}(\hat{\text{O }})}{N_{\text{TWA}}}. \tag{28}\]  
The ratio of \(N_{\text{traj}}\) and \(N_{\text{TWA}}\) needed for the same precision can be found by equating (27) and (28) to be:  
\[\frac{N_{\text{TWA}}}{N_{\text{traj}}}=1+\frac{\text{Var}_{1}(\hat{\text{O}})} {\text{Var}_{2}(\hat{\text{O}})}. \tag{29}\]  
In this sense, variational trajectories may even outperform TWA computationally. As an example, in Figure 5, the same process as in Figure 4 is simulated with only ten samples of the exact/variational trajectories and ten samples of TWA. It is clear that TWA provides a bad estimate with such a low number of samples. The performance of trajectory methods with regard to the minimal amount of samples, though observable and unraveling dependent, is better. The amount of improvement depends on \(\hat{\text{O}}\) and the unraveling: as seen from Equation (29), the photon-counting unraveling performs best because \(\text{Var}_{1}(X)\gg\text{Var}_{2}(X)\), as can be appreciated from Figure 4.  
When it is a phase-space distribution itself that one is interested in, it can again be challenging to compute it from an exact density matrix or wavefunction, when the particle number is not low [72]. If a state is Gaussian, particularly in the \(XP\)-sense, distributions for individual samples are given by straightforward Gaussian formulas [42] that can be added up for the distribution of the whole ensemble. The TWA method is by construction surely also very well suited to plot the Wigner-quasi-probability function, but binning as a histogram is necessary there, meaning that again, a much larger amount of samples is required for a result of high resolution. As a final note, all simulations discussed have been performed by trajectories representing pure states.