Skip to main content

A stochastic evaluation of quantum Fisher information matrix with generic Hamiltonians


Quantum Fisher information matrix (QFIM) is a fundamental quantity in quantum physics, which closely links to diverse fields such as quantum metrology, phase transitions, entanglement witness, and quantum speed limit. It is crucial in quantum parameter estimation, central to the ultimate Cramér-Rao bound. Recently, the evaluation of QFIM using quantum circuit algorithms has been proposed for systems with multiplicative parameters Hamiltonian. However, systems with generic Hamiltonians still lack these proposed schemes. This work introduces a quantum-circuit-based approach for evaluating QFIM with generic Hamiltonians. We present a time-dependent stochastic parameter-shift rule for the derivatives of evolved quantum states, whereby the QFIM can be obtained. The scheme can be executed in universal quantum computers under the family of parameterized gates. In magnetic field estimations, we demonstrate the consistency between the results obtained from the stochastic parameter-shift rule and the exact results, while the results obtained from a standard parameter-shift rule slightly deviate from the exact ones. Our work sheds new light on studying QFIM with generic Hamiltonians using quantum circuit algorithms.

1 Introduction

The objective of quantum metrology is that using nonclassical quantum resources to enhance the precision in the estimation of unknown parameters [1, 2], including entanglement [39] and squeezing states [1012]. Its cornerstone is the quantum estimation theory, which imposes the lower bound of precision by the quantum Cramér-Rao inequality [13]. The bound is associated with quantum Fisher information (QFI) for single-parameter estimation and quantum Fisher information matrix (QFIM) for multiparameter estimation. Beyond the estimation theory, QFI and QFIM also connect to various aspects of quantum physics, including quantum phase transitions, entanglement witness, and the Fubini-Study metric, making them being fundamental quantities with broad applications (See Ref. [14] and references therein). Therefore, the evaluation of QFI and QFIM is crucial for studying these concepts.

Numerous studies on QFI and QFIM mainly focus on multiplicative parameters of Hamiltonians, e.g., a parameter θ in a Hamiltonian θH [15]. However, recent attention was raised to generic parameters of Hamiltonians, such as quantum magnetometry [7, 15, 16], unitary parametrization process [17, 18], and time-dependent Hamiltonians [19, 20]. While the estimation with generic Hamiltonians shares some typical properties with the multiplicative case, it likewise indicates other distinct features, such as getting high efficiency with time scaling [15] and quantum control [19, 20]. The study of QFI/QFIM in these generic cases will open a broad range of potential applications in quantum metrology, quantum computing, and others.

On the other side, quantum computers can outperform classical ones and open significant quantum advantages for exponentially speeding up various computational tasks [21, 22]. Specifically, using Noisy Intermediate-Scale Quantum computers [23] resulted in the brilliant growth of different quantum algorithms (see Refs. [24, 25].) Among them, variational quantum algorithms [24] are the most promising approach for improving the efficiency in noisy and few-qubits devices. These algorithms include variational quantum eigensolvers [2628], quantum approximate optimization algorithms [29], new frontiers in quantum foundations [3032], and so on.

Besides, many computational tools based on variational quantum circuits were developed, including the standard parameter-shirt rules (Stand.PSR) [33, 34] and quantum natural gradient [35]. The Stand.PSR allows us to get the exact partial derivatives of any function by calculating it with different shifted parameters in the circuits. However, it only applies to cases where the gate’s generators commute. Otherwise, to apply the Stand.PSR, additional treatments are required, such as Hamiltonian simulation techniques [36]. Recently, Banchi and Crooks in their seminal work, have developed a stochastic parameter-shift rule (Stoc.PSR) for general quantum evolutions, which relies on the stochastic repetitions of quantum measurement [37].

So far, different variational quantum algorithms for quantum metrology were developed, which open a new way to achieve quantum-enhanced precision [31, 32, 38, 39]. Moreover, the Stand.PSR was widely used in various aspects, including finding the QFI with multiplicative Hamiltonians [40, 41]. However, it is lacking in the study of generic Hamiltonians. In reality, many systems are governed by generic Hamiltonians. Therefore, studying these cases using quantum algorithms is urgent.

This paper introduces a general time-dependent Stoc.PSR and applies it to evaluate QFI/QFIM. We utilize the proposed Stoc.PSR for the derivatives of evolved quantum states, then compute the QFI/QFIM and examine the estimation precision in quantum metrology. Our scheme can execute in universal quantum computers under the family of parameterized gates. In magnetic field estimations, we show an excellent agreement between the results obtained from the Stoc.PSR and the exact results while the Stand.PSR’s results deviate from the exact values. This observation suggests the significance of the Stoc.PSR for studying QFI/QFIM with generic Hamiltonians and its applicability to variational quantum metrology. Furthermore, we extend our approach to examine the precision in many-body Hamiltonian tomography, such as estimating unknown coupling constants in the Hamiltonian.

2 Results and discussion

2.1 Quantum Fisher information for generic Hamiltonians

Estimation is a measurement process that uses a probe to extract information from an interesting system with d unknown parameters in a field \(\boldsymbol{B} = \phi _{1}\boldsymbol{e}_{1} + \cdots + \phi _{d}\boldsymbol{e}_{d}\), where \(\{\boldsymbol{e}_{j}\}\) are unit vectors in \(\{j\}\) directions. The probe interacts with the system through a generic Hamiltonian \(H(\boldsymbol{\phi} ) = \boldsymbol{B} \cdot \boldsymbol{H} = \sum_{j=1}^{d} \phi _{j}H_{j}\), where the \(\{H_{j}\}\) do not necessarily commute. The task of quantum parameters estimation is to evaluate these unknown coefficients by measuring the probe.

Let \(\rho _{0}\) be the initial probe state, it evolves to \(\rho (\boldsymbol{\phi} ) = U(\boldsymbol{\phi} )\rho _{0}U^{\dagger}(\boldsymbol{\phi} )\) after the interaction, where \(U(\boldsymbol{\phi} ) = e^{-itH(\boldsymbol{\phi} )}\) is the unitary evolution during the interaction time t. Note that \(H(\boldsymbol{\phi} )\) is a general Hamiltonian, therefore \(U(\boldsymbol{\phi} )\) cannot be expanded in terms of multiplicative. By measuring the probe state in a general basis set, such as the positive operator-valued measure (POVM) \({E_{x}}\) for the outcome x, one can obtain the corresponding probability distribution \(p(x|\boldsymbol{\phi} ) = \operatorname{tr} [\rho (\boldsymbol{\phi} )E_{x} ]\), which can be used to estimate the unknown parameters ϕ.

In the estimation theory, different estimators can be used to obtain the estimated value \(\boldsymbol{\check{\phi}}(x)\) of the unknown parameters ϕ, each yielding different precisions. The precision is characterized by the covariance matrix \(C(\boldsymbol{\phi} ) = {\mathrm{E}} [(\boldsymbol{\phi} - {\mathrm{E}}[\boldsymbol{\check{\phi}}(x)]) ( \boldsymbol{\phi} - {\mathrm{E}}[\boldsymbol{\check{\phi}}(x)])^{\intercal} ]\) [8], where \(\mathrm{E}[\boldsymbol{\check{X}}]=\int p(x|\boldsymbol{X}) \boldsymbol{\check{X}}(x) \,\mathrm{d}x\) is the expectation value of the estimator \(\boldsymbol{\check{X}}(x)\). The diagonal term \(C_{k,k} \equiv \Delta ^{2}\phi _{k} = {\mathrm{E}}[\phi _{k}^{2}]-{\mathrm{E}}^{2}[ \phi _{k}]\) is the variance for estimating \(\phi _{k}\), and the off-diagonal term \(C_{k,l}\) is the covariance between \(\phi _{k}\) and \(\phi _{l}\). An estimator is unbiased when \(\mathrm{E}[\check{\phi}_{k}(x)] = \phi _{k}\), \(\forall k \in \{ 1,\ldots ,d\}\). The precision obeys classical and quantum Cramér-Rao bounds (CRBs) [13]

$$\begin{aligned} M\cdot C(\boldsymbol{\phi} ) \ge F^{-1}(\boldsymbol{\phi} ) \ge Q^{-1}(\boldsymbol{\phi} ), \end{aligned}$$

where M is the number of repeated measurements, \(F(\boldsymbol{\phi} )\) is the classical Fisher information matrix (CFIM) defined by

$$\begin{aligned} F_{k,l} = \int \frac {1}{p(x|\boldsymbol{\phi} )} \bigl[\partial _{\phi _{k}} p(x| \boldsymbol{ \phi} ) \bigr] \bigl[\partial _{\phi _{l}} p(x|\boldsymbol{\phi} ) \bigr] \,\mathrm{d}x, \end{aligned}$$

and the maximum over all possible measurements \(\{E_{x}\}\) yields the quantum Fisher information matrix (QFIM) \(Q(\boldsymbol{\phi} )\) with elements

$$\begin{aligned} Q_{k,l} = \frac {1}{2}\operatorname{tr} \bigl[ \rho (\boldsymbol{\phi} )\{L_{k},L_{l}\} \bigr], \end{aligned}$$

where \(L_{k}\) is the symmetric logarithmic derivative (SLD) that obeys \(2\partial _{\phi _{k}}\rho (\boldsymbol{\phi} ) = L_{k}\rho (\boldsymbol{\phi} ) + \rho ( \boldsymbol{\phi} )L_{k}\) [13]. For a single parameter estimation (such as ϕ), the CRBs simplify to \(\Delta ^{2}\phi \ge 1/F(\phi ) \ge 1/Q(\phi )\), where \(F(\phi ) = \int p(x|\phi ) [\partial _{\phi}\ln p(x|\phi ) ]^{2}\,\mathrm{d}x\) and \(Q(\phi ) = \operatorname{tr} [L^{2} \rho (\phi ) ]\) are the classical and quantum Fisher information, respectively. Note that both CFIM and QFIM may depend on the parameters ϕ regardless of the unitary process.

The QFI and QFIM set ultimate bounds for the estimation precision of any estimator. Therefore, it is crucial to derive these QFI and QFIM for the estimation theory with generic Hamiltonians. Let us start with the derivative of the unitary evolution [16, 42]

$$\begin{aligned} \frac {\partial e^{-itH(\boldsymbol{\phi} )}}{ \partial \phi _{j}} &= -i \int _{0}^{t} e^{-i(t-s)H(\boldsymbol{\phi} )} \bigl[ \partial _{\phi _{j}} H(\boldsymbol{\phi} ) \bigr] e^{-isH(\boldsymbol{\phi} )} \,\mathrm{d}s, \\ &=-iU(\boldsymbol{\phi} )Y_{j}, \end{aligned}$$

where \(Y_{j} = \int _{0}^{t} e^{isH(\boldsymbol{\phi} )} [\partial _{\phi _{j}} H( \boldsymbol{\phi} ) ]e^{-isH(\boldsymbol{\phi} )} \,\mathrm{d}s \) is a Hermitian operator [16]. Then, we obtain

$$\begin{aligned} \frac {\partial \rho (\boldsymbol{\phi} )}{ \partial \phi _{j}} = -iU(\boldsymbol{\phi} ) [Y_{j},\rho _{0} ]U^{ \dagger}(\boldsymbol{\phi} ). \end{aligned}$$

The QFIM (3) straightforwardly yields

$$\begin{aligned} Q_{k,l} = 2\sum_{p_{\lambda}+p_{\lambda '}>0} \frac {\langle \lambda \vert \partial _{\phi _{k}}\rho (\boldsymbol{\phi} ) \vert \lambda '\rangle \langle \lambda ' \vert \partial _{\phi _{l}}\rho (\boldsymbol{\phi} ) \vert \lambda \rangle}{ p_{\lambda}+p_{\lambda '}}, \end{aligned}$$

for \(\rho (\boldsymbol{\phi} ) = \sum_{\lambda }p_{\lambda}|\lambda \rangle \langle \lambda |\), and \(\partial _{\phi _{k}}\rho (\boldsymbol{\phi} )\) is given from Eq. (5). For pure quantum states, i.e., \(\rho _{0} = |\psi _{0} \rangle \langle \psi _{0}|\), the QFIM is defined by [13]

$$\begin{aligned} Q_{k,l} &= 4\operatorname{Re} \bigl[\bigl\langle \partial _{\phi _{k}}\psi (\boldsymbol{\phi} ) \bigl\vert \partial _{\phi _{l}} \psi (\boldsymbol{\phi} )\bigr\rangle -\bigl\langle \partial _{\phi _{k}} \psi (\boldsymbol{\phi} ) \bigr\vert \psi (\boldsymbol{\phi} ) \bigr\rangle \bigl\langle \psi (\boldsymbol{\phi} )\big|\partial _{\phi _{l}}\psi ( \boldsymbol{\phi} ) \bigr\rangle \bigr], \end{aligned}$$

where \(|\psi (\boldsymbol{\phi} )\rangle = U(\boldsymbol{\phi} )|\psi _{0}\rangle \) is the evolved probe state. Substituting Eq. (4) into Eq. (7), it yields [7, 16]

$$\begin{aligned} Q_{k,l} = 4\operatorname{Re} \bigl[ \langle \psi _{0} \vert Y_{k}Y_{l} \vert \psi _{0} \rangle -\langle \psi _{0} \vert Y_{k} \vert \psi _{0}\rangle \langle \psi _{0} \vert Y_{l} \vert \psi _{0}\rangle \bigr]. \end{aligned}$$

Computing QFI and QFIM requires the derivatives of the probe state, i.e., \(\partial _{\phi _{j}}\rho (\boldsymbol{\phi} )\), \(\forall j\in \{1,\ldots ,d\}\). Hereafter, we introduce a stochastic parameter-shift rule (Stoc.PSR) to compute these derivatives on quantum circuits, allowing for precision evaluation in different quantum computing platforms.

2.2 Stochastic parameter-shift rule

In this section, we present a time-dependent stochastic parameter-shift rule (Stoc.PSR) for evaluating QFI/QFIM with generic Hamiltonians, where we particularly calculate \(\partial _{\phi _{j}}\rho (\boldsymbol{\phi} )\) using quantum circuits. This method is thus helpful for studying different variational quantum algorithms [24], including variational quantum metrology [31, 32, 39] and evaluating Fubini-Study metric tensor in quantum natural gradient [35].

We first recast Eq. (5) in the following form

$$\begin{aligned} \frac {\partial \rho (\boldsymbol{\phi} )}{ \partial \phi _{j}} = -i \int _{0}^{t} U(\boldsymbol{\phi} ) [O_{j},\rho _{0} ]U^{\dagger}(\boldsymbol{\phi} ) \,ds, \end{aligned}$$

where \(O_{j} = e^{isH(\boldsymbol{\phi} )} [\partial _{\phi _{j}} H(\boldsymbol{\phi} ) ]e^{-isH(\boldsymbol{\phi} )} \). Referring to [37] and using the Baker-Campbell-Hausdorff formula [43] for \(H_{j}^{2} = I\), we derive

$$\begin{aligned}{} [O_{j},\rho _{0} ] = \frac {i}{\sin (2t\mu )} \bigl[e^{-it\mu O_{j}} \rho _{0}e^{it\mu O_{j}} - e^{it\mu O_{j}}\rho _{0}e^{-it\mu O_{j}} \bigr], \end{aligned}$$

for all \(t\mu \notin \frac{\pi}{2} \mathbb{Z}\). See Methods section for the detailed proof. Recall that Ref. [37] fixes \(\mu = \pi /4\) and \(t = 1\). Here, we consider any time t and introduce μ as an arbitrary parameter shift, which makes our scheme more general, especially in time-dependent and noisy metrology. For \(t\mu = \pi /4\), it reduces to Ref. [37] and maximizes the accuracy for parameter-shift approaches (se also Ref. [44].) Finally, using \(e^{-it\mu O_{j}} = e^{isH(\boldsymbol{\phi} )} e^{-it\mu [\partial _{\phi _{j}} H(\boldsymbol{\phi} )]} e^{-isH(\boldsymbol{\phi} )} \) [42], and substituting Eq. (10) into Eq. (9), we obtain (see the Methods section):

$$\begin{aligned} \frac {\partial \rho (\boldsymbol{\phi} )}{ \partial \phi _{j}} =\frac {1}{\sin (2t\mu )} \int _{0}^{t} \bigl[ \rho _{j}^{+}( \boldsymbol{\phi} ,s) - \rho _{j}^{-}(\boldsymbol{\phi} ,s) \bigr] \,\mathrm{d}s, \end{aligned}$$

which is the time-dependent stochastic parameter-shift rule (Stoc.PSR), where

$$\begin{aligned} &\rho _{j}^{\pm}(\boldsymbol{\phi} ,s)= U_{j}^{\pm}(\boldsymbol{\phi} ,s)\rho _{0} \bigl[U_{j}^{ \pm}(\boldsymbol{\phi} ) \bigr]^{\dagger}, \end{aligned}$$
$$\begin{aligned} &U_{j}^{\pm}(\boldsymbol{\phi} ,s)=e^{-i(t-s)H(\boldsymbol{\phi} )} e^{\mp it\mu [ \partial _{\phi _{j}} H(\boldsymbol{\phi} ) ]} e^{-isH(\boldsymbol{\phi} )}. \end{aligned}$$

The algorithm for time-dependent Stoc.PSR is described in Algorithm 1, which is an extended version of the original (without time-dependent) in Ref. [37]. Figure 1 depicts a quantum circuit for the Stoc.PSR. To obtain \(\partial _{\phi _{j}}\rho (\boldsymbol{\phi} )\) for a given time t, we perform the following steps: (s1) generate a random number s from a normal distribution within the interval \([0,t]\); (s2) initialize the circuit with \(\rho _{0}\); (s3) apply the quantum gates \(e^{-isH(\boldsymbol{\phi} )}\), \(e^{-it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\), and \(e^{-i(t-s)H(\boldsymbol{\phi} )}\); (s4) extract the final state \(\rho ^{+}\) from the circuit; (s5) repeat steps s2-s4, replacing \(e^{-it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\) with \(e^{it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\), and assign the quantum state to \(\rho ^{-}\); (s6) repeat steps s1-s5 N times and compute the derivative via \(\frac{t}{N*\sin (2t\mu )}\sum_{n=1}^{N}(\rho ^{+}-\rho ^{-})\). The term \(t/N\) comes from Monte-Carlo sampling, i.e., \(\int _{a}^{b} f(x) \,dx \approx \frac{b-a}{N}\sum_{i=1}^{N}f(x_{i})\). Apply the procedure for all \(j\in {1,\ldots , d}\) and use Eqs. (6)-(7) we can compute the QFIM. Finally, we repeat the scheme for other time instances.

Figure 1
figure 1

Quantum circuit for time-dependent stochastic parameter-shift rule (Stoc.PSR). For every time t, we first prepare a quantum state \(\rho _{0}\) and generate a random number \(s \in [0,t]\). A sequence of gates \(e^{-isH(\boldsymbol{\phi} )}\), \(e^{-it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\), and \(e^{-i(t-s)H(\boldsymbol{\phi} )}\) applies to the circuit and produces \(\rho ^{+}\). We then repeat the scheme while replacing \(e^{-it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\) by \(e^{it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\) and compute \(\rho ^{-}\). The derivative \(\partial _{\phi _{j}}\rho (\boldsymbol{\phi} )\) is obtained via \(\rho ^{+}-\rho ^{-}\). The process is then repeated for all \(\phi _{j}\) to get the QFIM \(Q(\boldsymbol{\phi} )\). Then, we move to the next time \(t'\) and do the same procedure

Note that the scheme can be implemented in universal quantum computers. Assuming a programmable quantum computer that can execute a family of native quantum gates \(U(t,\boldsymbol{\phi} ) = e^{-itH(\boldsymbol{\phi} )}\), where \(H(\boldsymbol{\phi} ) = \sum_{j}\phi _{j}H_{j}\), the evolution terms \(e^{-i(t-s)H(\boldsymbol{\phi} )}\) and \(e^{-isH(\boldsymbol{\phi} )}\) in step 3 can be implemented by using the quantum gates \(U(t-s,\boldsymbol{\phi} )\) and \(U(s,\boldsymbol{\phi} )\), respectively. The remaining term \(e^{-it\mu [\partial _{\phi _{j}}H(\boldsymbol{\phi} )]}\) in step 3 yields \(e^{-it\mu H_{j}}\), which can be implemented by the quantum gate \(U (t\mu ,\boldsymbol{e}_{j} )\), where \(\boldsymbol{e}_{j}\) is a unit vector with 1 at the \(j^{\mathrm{th}}\) element and zeros for the others. Therefore, all the evolution terms can be implemented by the device. The density states \(\rho ^{+}\) and \(\rho ^{-}\) can be extracted and subtracted from each other using classical computers or quantum subtraction technology in real hardware, e.g., see Ref. [45].

So far, the accuracy of an approach (such as finite difference, Stand.PSR, and Stoc.PSR) is determined by its variance, which is a statistical error raising from a finite number of measurements. The variance of the Stoc. PSR is comparable with that of the Stand. PSR when an infinite number of measurements are taken. [37]

Finally, the algorithm’s complexity is calculated using the Big O notation (\(\mathcal{O}\)). Following Ref. [46], the complexity of the evolution gate \(e^{-it H(\phi )}\) is \(\mathcal{O}(N^{3})\). When considering the set of three evolution terms shown in Fig. 1, the total complexity is \(\mathcal{O}(3N^{3})\), which can be simplified to \(\mathcal{O}(N^{3})\) by removing the constant term.

2.3 Applications

To demonstrate advantaged features of the Stoc.PSR method for evaluating QFIM, we scrutinize quantum metrology in two cases of single and multiple magnetic fields. We further discuss its application to Hamiltonian tomography in many-body systems, which involves determining unknown coupling constants in the Hamiltonian.

2.3.1 Single parameter estimation

Let us consider a magnetic field \(\boldsymbol{B} = \cos (\phi )\boldsymbol{e}_{x} + \sin (\phi )\boldsymbol{e}_{z}\), and our goal is to estimate the angle ϕ between the field’s direction and the z axis [15]. The field interacts with an exposed qubit probe and imprints its information into the probe via the interaction Hamiltonian

$$\begin{aligned} H(\phi ) = \boldsymbol{B}\cdot \boldsymbol{\sigma} = \cos (\phi ) \sigma _{x} + \sin ( \phi )\sigma _{z}, \end{aligned}$$

where \(\boldsymbol{\sigma} = (\sigma _{x}, \sigma _{y}, \sigma _{z})\) are the Pauli matrices. The unitary evolution is given by \(U(t,\phi ) = e^{-itH(\phi )}\). Applying this transformation, an initial probe state, i.e., \(|\psi _{0}\rangle = (|0\rangle + |1\rangle )/\sqrt{2}\) evolves to \(|\psi (\phi )\rangle = U(t,\phi )|\psi _{0}\rangle \). The evolved probe state \(|\psi (\phi )\rangle \) provides the best quantum strategy for the estimation of ϕ, which can be evaluated via the QFI, similar to Eq. (8)

$$\begin{aligned} Q(\phi ) &=4\operatorname{Re} \bigl[ \bigl\langle \psi _{0} \bigl\vert Y_{\phi}^{2} \bigr\vert \psi _{0} \bigr\rangle - \bigl\vert \langle \psi _{0} \vert Y_{\phi} \vert \psi _{0}\rangle \bigr\vert ^{2} \bigr] \\ & = 4\sin ^{2}(t) \bigl[1-\cos ^{2}(t)\sin ^{2}( \phi ) \bigr], \end{aligned}$$

where \(Y_{\phi }= \int _{0}^{t} e^{isH(\phi )} [\partial _{\phi} H( \phi ) ]e^{-isH(\phi )} \,\mathrm{d}s \) (see detailed in the Methods section). The QFI \(Q(\phi )\) is time-dependent and achieves a maximum value of 4 at \(t = \pi /2\), as shown by the solid curves in Fig. 2. This behavior is caused by the rotation of the probe state under magnetic field. Furthermore, the QFI depends on the true parameter value, it thus becomes a function of ϕ. In the limit \(\phi \to 0\), the QFI yields \(Q(\phi ) = Q_{\mathrm{max}} = 4\sin ^{2}(t)\) [15].

Figure 2
figure 2

Quantum Fisher information for single magnetic field estimation. Quantum Fisher information \(Q(\phi )\) as a function of the interaction time t for different choices of ϕ, as shown in the figure. The solid curves are exact results from theoretical analysis Eq. (15), the dashed curves are obtained from the Trotter-Suzuki transformation and Stand.PSR, and the dotted curves are obtained from the Stoc.PSR. It can be observed that \(Q(\phi )\) varies with time t and reaches its maximum at \(t = \pi /2\). More importantly, the results show that the Stoc.PSR agrees with the exact analysis while the Stand.PSR gradually deviates from the exact one. The mean-square error (MSE) are plotted as error bars and error areas in the figure. They are systematic errors that caused by different calculation methods

We now apply the Stoc.PSR to a single-qubit quantum circuit. The circuit is initially prepared in \(|0\rangle \), and it becomes \(|\psi _{0}\rangle \) after applying a Hadamard gate. Using the definition \(\partial _{\phi }|\psi (\phi )\rangle = [\partial _{\phi }U(t, \phi ) ]|\psi _{0}\rangle \), and the first line in Eq. (4), we have

$$\begin{aligned} \frac {\partial |\psi (\phi )\rangle}{ \partial \phi} = -i \int _{0}^{t} U(t,\phi ) O_{\phi }|\psi _{0} \rangle \,\mathrm{d}s, \end{aligned}$$

where \(O_{\phi }= e^{isH(\phi )}[\partial _{\phi }H(\phi )] e^{-isH(\phi )}\). Similar as above, we have

$$\begin{aligned} O_{\phi}|\psi _{0}\rangle = \frac {i}{2\sin (\mu t)} \bigl[e^{-it\mu O_{ \phi}}-e^{it\mu O_{\phi}} \bigr] |\psi _{0}\rangle , \end{aligned}$$

where \(t\mu \notin \pi \mathbb{Z}\). Using \(e^{-it\mu O_{\phi}} = e^{isH(\phi )}e^{-it\mu [\partial _{\phi }H( \phi )]} e^{-isH(\phi )}\), we derive Eq. (16) as

$$\begin{aligned} \frac {\partial |\psi (\phi )\rangle}{ \partial \phi} = \frac {1}{2\sin (t\mu )} \int _{0}^{t} \bigl[ \bigl\vert \psi ^{+} \bigr\rangle - \bigl\vert \psi ^{-}\bigr\rangle \bigr] \,\mathrm{d}s, \end{aligned}$$

where \(|\psi ^{\pm}\rangle \) are given by

$$\begin{aligned} \bigl|\psi ^{\pm}\bigr\rangle = U(t-s,\phi )\cdot e^{\mp it\mu [\partial _{ \phi }H(\phi )]} \cdot U(s,\phi )|\psi _{0}\rangle . \end{aligned}$$

In the numerical calculation, we derive \(\partial _{\phi}|\psi (\phi )\rangle =\frac{t}{N*2\sin (t\mu )} \sum_{n=1}^{N} [|\psi ^{+}\rangle - |\psi ^{-}\rangle ]\) with N samplings of \(s\in [0,t]\). This is a simplified version of Algorithm 1 for pure states. We set \(N = 1000\) and obtain the QFI \(Q(\phi )\) which is of the form (7)

$$\begin{aligned} Q(\phi ) = \frac {t^{2}}{N^{2}\sin ^{2}(t\mu )}\operatorname{Re} \bigl[\langle \Psi \vert \Psi \rangle - \bigl\vert \bigl\langle \Psi \big\vert \psi ( \phi )\bigr\rangle \bigr\vert ^{2} \bigr], \end{aligned}$$

where \(|\Psi \rangle = \sum_{n=1}^{N} [|\psi ^{+}\rangle -|\psi ^{-} \rangle ]\).

Algorithm 1
figure a

Stochastic parameter-shift rule for calculating \(\partial _{\phi _{j}}\rho (\boldsymbol{\phi} )\) in quantum circuits

To implement the Stoc.PSR in quantum computers, we assume there exists a universal quantum hardware that allows for executing the quantum gate \(U(t,\phi )\). Changing the variables in \(U(t,\phi )\) by \(U(x,z) = e^{-it(x\sigma _{x} + z\sigma _{z})}\) where \(x = \cos (\phi )\) and \(z = \sin (\phi )\), it yields \(\partial _{\phi }U(x,z) = \partial _{x} U(x,z)\partial _{\phi }x + \partial _{z} U(x,z)\partial _{\phi }z\). This is a universal quantum device because all the evolution terms in Eq. (19) can be implemented via this quantum gate in the device.

Finally, let us compare the results with the Stand.PSR. To apply the Stand.PSR, we first decompose the evolution \(U(t,\phi )\) into a sequence of sub-evolutions through Trotter-Suzuki transformation [47]

$$\begin{aligned} U(t,\phi ) = \lim_{m\to \infty} \bigl(e^{-it\cos (\phi )\sigma _{x}/m} e^{-it\sin (\phi )\sigma _{z}/m} \bigr)^{m}, \end{aligned}$$

where these sub-evolutions can be executed in quantum circuits through rotation gates, specifically Rx and Rz. The derivative \(\partial _{\phi}|\psi (\phi )\rangle \) now can be implemented by using the Stand.PSR. See detailed calculation in the Method section.

Figure 2 shows a comparison between the performance of Stand.PSR and Stoc.PSR with the exact theoretical result. The Stoc.PSR consistently demonstrates a good agreement with the exact results all the time while the Stand.PSR deviates from the exact results as time increases. It implies that using Stoc.PSR in quantum circuits for studying quantum systems with generic Hamiltonian is essential and cannot be replaced by similar approximation methods. This is further supported by considering the mean-square error (MSE), defined as \((1/M)\sum_{i} [y_{i}(t) - f(t)]^{2}\), where M denotes the number of data points, \(y_{i}(t)\) represents the data obtained using the Stand.PSR or Stoc.PSR and \(f(t)\) represents the exact results given by Eq. (15). We emphasize that the MSE here plays no role with the error of the estimated parameter, it is rather a systematic error caused by different methods when comparing with the exact theoretical result. The MSEs are shown in the figure as the error bars and error areas. As we can see, the MSE for Stoc.PSR remains small throughout the duration, while that one for the Stand.PSR divers for large sensing time t.

2.3.2 Multiple parameters estimation

Next, we apply the Stoc.PSR scheme to estimate the components of a magnetic field pointing in an arbitrary direction. Consider the probe state initially prepared in n-qubit GHZ state \(|\psi _{0}\rangle = (|00\cdots 0\rangle + |11\cdots 1\rangle )/\sqrt{2}\), such that allows for obtaining the maximum QFIM [6]. The interaction Hamiltonian is given by

$$\begin{aligned} H(\boldsymbol{\phi} ) = \sum_{j} \phi _{j}J_{j},\quad \text{for } j\in \{x, y, z \}, \end{aligned}$$

where \(\boldsymbol{\phi} = (\phi _{x}, \phi _{y}, \phi _{z})\) are three components of the given magnetic field that we want to estimate, and \(J_{j} = \sum_{k=1}^{n}\sigma _{j}^{(k)}\) is a collective Pauli matrix. Potential platforms for the probe include spin-1/2 ensemble semiconductors, ions traps, NMR systems, and NV centers. In these systems, such as spin-1/2 ensemble, \(J_{j}\) becomes the collective angular momentum operator [7].

The QFIM can be obtained theoretically from Eq. (8), and the total variance yields \(\Delta ^{2}\boldsymbol{\phi} = \operatorname{tr}[Q^{-1}]\). Concretely, with \(n = 3\) qubits and \(\phi _{x} = \phi _{y} = \phi _{z} = \varphi \), we obtain

$$\begin{aligned} \operatorname{tr}\bigl[Q^{-1}\bigr] = \frac {7}{108t^{2}} + \frac {3\varphi ^{2}}{54\sin ^{2}(\sqrt{3}\varphi t)}. \end{aligned}$$

We show the exact theoretical results by the solid curves for various φ in Fig. 3a. For each φ, there is a minimum variance at a certain time t, which is caused by the rotation of the probe state under magnetic field. In the limit of small phase, i.e., \(\varphi \to 0\), the total variance is \(\operatorname{tr}[Q^{-1}] = \frac{7}{108t^{2}}\), which results in the minimum of total variance.

Figure 3
figure 3

The total variance for multiphase magnetic field estimation. (a) The total variance \(\Delta ^{2}\boldsymbol{\phi} = \operatorname{tr}[Q^{-1}]\) as a function of the interaction time t for different choices of φ as shown in the figure. Here, we use \(\phi _{x} = \phi _{y} = \phi _{z} = \varphi \) for illustration (although in general, these values may differ). The solid curves are exact results, which are given by theoretical analysis, and the dotted curves are obtained from the Stoc.PSR. It can be observed that \(\operatorname{tr}[Q^{-1}]\) varies with t and reaches its minimum at a certain time. More importantly, the results show a good agreement between the Stoc.PSR and the exact theoretical analysis. (b) Plot of the total variance versus t under the time-dependent dephasing noise for various decay rates γ. Here, we fixed \(\varphi = \pi /10\)

In the Stoc.PSR method, we model the probe in an n-qubit quantum circuit initially prepared in the GHZ state. The circuit can be implemented in the existing noisy intermediate-scale quantum computers [23]. Its state evolves under the transformation \(U(t,\boldsymbol{\phi} )= e^{-itH(\boldsymbol{\phi} )}\), and results in the evolved state \(|\psi ({\boldsymbol{\phi}})\rangle = U(t,\boldsymbol{\phi} )|\psi _{0}\rangle \). As discussed above, this unitary evolution can be implemented in a universal quantum computer. Therefore, we employ the Stoc.PSR using Algorithm 1 to obtain \(\partial _{\phi _{j}}|\psi (\boldsymbol{\phi} )\rangle \) for all j and get the QFIM as in Eq. (7). The \(\operatorname{tr}[Q^{-1}]\) is shown in Fig. 3a (dotted curves) for the number of sampling \(N = 1000\). The Stoc.PSR’s results agree with the exact results.

We further apply the scheme to noisy cases, where the probe is described by mixed states. We consider time-dependent dephasing, which is given by a quantum channel \(\mathcal{E}\) that acts on a single qubit as

$$\begin{aligned} \mathcal{E} [\rho ] := K_{1}\rho K_{1}^{\dagger }+ K_{2}\rho K_{2}^{ \dagger}, \end{aligned}$$

where we used the Kraus representation for the dephasing channel [31]

$$\begin{aligned} K_{1} = \begin{pmatrix} p(t) & 0 \\ 0 & 1 \end{pmatrix},\qquad K_{2} = \begin{pmatrix} \sqrt{1-p^{2}(t)} & 0 \\ 0 & 0 \end{pmatrix}. \end{aligned}$$

The time-dependent probability is \(p(t) = e^{-\gamma t}\) for the Markovian noise, where γ is the decay rate [31].

We apply the quantum channel \(\mathcal{E}\) to all qubits in the probe during the interaction time and use Algorithm 1 to derive the QFIM. The results for the total variance versus the interaction time t are shown in Fig. 3b. We plot the results for several decay rates γ and compare the Stoc.PSR approach with the theoretical analysis. Again, they match excellently.

2.3.3 Hamiltonian tomography

We additionally discuss the application to Hamiltonian tomography in many-body systems, which involves determining unknown coupling constants in the Hamiltonian. Hamiltonian tomography aims to reconstruct a generic many-body Hamiltonian by measuring multiple pairs of the initial and time-evolving states. It is a challenging task due to the complexity of the many-body dynamics. So far, the progress is limited to particular Hamiltonians and small-size systems [4851]. For example, a simple task is to identify the Hamiltonian in an Ising model of a spin-1/2 chain placed under an external field. A generic Hamiltonian is given by \(H = \sum_{j} c_{j,j+1}\sigma _{z}^{(j)} \sigma _{z}^{(j+1)} + \sum_{j} h_{j} \sigma _{x}^{(j)} \), where the coupling constants \(\{c_{j,j+1}\}\) and the external field strengths \(\{h_{j}\}\) are unknown factors, j stands for the site \(j^{\mathrm{th}}\) in the chain.

Recently, Li et al. introduced a quantum quench approach for the Hamiltonian tomography that can apply to both analog and digital quantum simulators [52]. Hereafter, we evaluate the quantum quench precision by using Stoc.PSR to calculate the classical Cramér-Rao bound.

A generic Hamiltonian of a many-body system can be decomposed into d-interaction terms as

$$\begin{aligned} H = \sum_{j = 1}^{d} x_{j} H_{j}, \end{aligned}$$

where \(\{x_{j}\}\) are unknown coupling constants that need to be determined, and \(\{H_{j}\}\) are Hermitian operators. An initial state \(\rho _{0}\) evolves to \(\rho (\boldsymbol{x}) = e^{-iHt}\rho _{0}e^{iHt}\) after time t, for \(\boldsymbol{x} = (x_{1}, \ldots , x_{d} )^{\intercal}\). The system obeys a conservation law [52]

$$\begin{aligned} \operatorname{tr} [\rho _{0}H ] = \operatorname{tr} \bigl[\rho (\boldsymbol{x})H \bigr], \end{aligned}$$

for every pair of given \(\rho _{0}\) and \(\rho (\boldsymbol{x})\). To determine d coefficients \(\{x_{j}\}\), we need to solve at least \(p \ge d-1\) linear equations which form a matrix equation as \({\boldsymbol{X}} \boldsymbol{x} = \boldsymbol{0}\), where X is a \(p\times d\) matrix with the elements

$$\begin{aligned} {X}_{k,l} = \operatorname{tr} \bigl[\rho _{0}^{(k)}H_{l} \bigr] - \operatorname{tr} \bigl[ \rho ^{(k)}(\boldsymbol{x})H_{l} \bigr], \end{aligned}$$

where \(k\in \{1,\ldots , p\}\) and \(l\in \{1, \ldots ,d\}\) for different pairs of \(\rho _{0}^{(k)}\), \(\rho ^{(k)}(\boldsymbol{x})\). Here, \(\{\rho _{0}^{(k)} \}\) is a set of (random) initial states and \(\{\rho ^{(k)}(\boldsymbol{x}) \}\) is a set of evolved states.

For \(\{H_{j}\}\) are measured observables, such as Pauli matrices, SIC-POVM, and polarization bases [53], the matrix elements \(\{X_{k,l}\}\) become measured probabilities under the eigenbases of these observables. Thus, to evaluate the best estimation of \(\{x_{j}\}\), we examine the classical bound, i.e., via the CFIM Eq. (2). Firstly, from Eq. (28), we derive

$$\begin{aligned} \frac {\partial X_{k,l}}{\partial x_{j}} = - \operatorname{tr} \biggl[ \biggl( \frac{\partial \rho ^{(k)}(\boldsymbol{x})}{ \partial x_{j}} \biggr)H_{l} \biggr], \end{aligned}$$

where \(\frac{\partial \rho ^{(k)}(\boldsymbol{x})}{ \partial x_{j}}\) is given by Stoc.PSR Eq. (11). We later define the CFIM as

$$\begin{aligned} F_{i,j} = \sum_{\{k,l\}} \frac {1}{ \vert X_{k,l} \vert } [\partial _{x_{i}} X_{k,l} ] [\partial _{x_{j}} X_{k,l} ], \quad \forall i,j \in \{1, \ldots ,d\}, \end{aligned}$$

and hence obtain the classical Cramér-Rao bound, i.e., \(\Delta ^{2}\boldsymbol{x} \ge \operatorname{tr}[F^{-1}]\). The equality can be achieved by an appropriate estimator.

For numerical demonstration, we consider a single-qubit system whose Hamiltonian is given by [53]

$$\begin{aligned} H = \sum_{i = 1}^{3} x_{i} \vert \psi _{i}\rangle \langle \psi _{i} \vert , \end{aligned}$$

where \(\{x_{i}\}\) are unknown coefficients, \(|\psi _{1}\rangle = |0\rangle , |\psi _{2}\rangle = (|0\rangle + |1 \rangle )/\sqrt{2}\), and \(|\psi _{3}\rangle = (|0\rangle + i|1\rangle )/\sqrt{2}\). We apply the quantum quench method to find \(\{x_{i}\}\) and analyze the variance \(\Delta ^{2}\boldsymbol{x}\). It is given by the classical Cramér-Rao bound, i.e., \(\Delta ^{2}\boldsymbol{x} = \operatorname{tr}[F^{-1}]\). The derivative \(\frac{\partial \rho ^{(k)}(\boldsymbol{x})}{ \partial x_{j}}\) in Eq. (29) is given by either Stoc.PSR or finite difference approach for comparison. For the Stoc.PSR, we run 1000 random samples of \(s \in [0,1]\), \(t = 1\), \(\mu = \pi /4\). For the finite difference method, we use \(\partial _{x}\rho (x) = \frac{ \rho (x+\epsilon ) - \rho (x-\epsilon )}{2\epsilon}\), where ϵ is a small step size. The variance \(\Delta ^{2}\boldsymbol{x}\) is averaged after 10 repetitions.

The results are shown in Fig. 4 as functions of p. In principle, \(p = d-1\) is sufficient to estimate d parameters. However, \(p > d-1\) gives better statistical results [52]. In this context, we compare the Stoc.PSR and finite difference approach, and find that they tend to converge when increasing p. While the finite difference method consistently produces better results, it also has a larger bias due to the computational challenges of computing \(\rho (x+\epsilon )\) and \(\rho (x-\epsilon )\) in quantum circuits for \(\epsilon \ll 1\). Furthermore, since p is equivalent with the number of repeated measurements, we can define the standard quantum limit (SQL) as \(\propto 1/p\) and Heisenberg limit (HL) by \(\propto 1/p^{2}\). We compare the bound in quantum quench with these limits and find that it scales slightly worse than the SQL, opening further exploring to improve the limit in quantum quench approaches.

Figure 4
figure 4

The classical Cramér-Rao bound in single-qubit Hamiltonian tomography. The results are plotted for two different approaches: Stoc.PSR (down triangle) and finite difference (up triangle). The standard quantum limit (SQL) and Heisenberg limit (HL) are shown for comparison. Here, SQL \(\propto 1/p\) and HL \(\propto 1/p^{2}\)

3 Conclusions

We proposed a time-dependent stochastic parameter-shift rule (Stoc.PSR) framework for deriving the differential in studying quantum Fisher information matrix with generic Hamiltonian generators. This method allows for obtaining the exact derivative using universal quantum circuits. Different from the standard parameter-shift rule (Stand.PSR), which particularly replies on commuting Hamiltonians, here, the Stoc. PSR applies to generic Hamiltonians.

Using the Stoc.PSR approach, the evaluation of QFI/QFIM can be practically executed in quantum circuits. In all cases, the Stoc.PSR results have agreed with the exact theoretical analysis, while the Stand.PSR results have deviated from the exact values. This framework can also be used for Hamiltonian tomography in many-body systems.

While variational quantum algorithms are extensively developing, our framework uses these advantages for the development of quantum metrology and quantum measurement with generic Hamiltonian and makes them reliable for studying in the area of quantum computers.

4 Methods

4.1 Proof of time-dependent stochastic parameter-shift rule

We consider the derivative of a mixed quantum state as in Eq. (9) in the main text

$$\begin{aligned} \frac {\partial \rho (\boldsymbol{\phi} )}{ \partial \phi _{j}} = -i \int _{0}^{t} U(\boldsymbol{\phi} ) [O_{j},\rho _{0} ]U^{\dagger}(\boldsymbol{\phi} ) \,ds, \end{aligned}$$

where \(O_{j} = e^{isH(\boldsymbol{\phi} )} [\partial _{\phi _{j}} H(\boldsymbol{\phi} ) ]e^{-isH(\boldsymbol{\phi} )} \). We have

$$\begin{aligned}{} [O_{j},\rho _{0} ] = \frac {i}{\sin (2t\mu )} \bigl[e^{-it\mu O_{j}} \rho _{0}e^{it\mu O_{j}} - e^{it\mu O_{j}}\rho _{0}e^{-it\mu O_{j}} \bigr], \end{aligned}$$


Using the Baker-Campbell-Hausdorff formula [43], we derive

$$\begin{aligned} e^{-it\mu O_{j}}\rho _{0}e^{it\mu O_{j}} = \rho _{0} &+ [-it\mu O_{j}, \rho _{0} ] + \frac {1}{2!} \bigl[-it\mu O_{j}, [-it\mu O_{j}, \rho _{0} ] \bigr] + \cdots \end{aligned}$$


$$\begin{aligned} e^{it\mu O_{j}}\rho _{0}e^{-it\mu O_{j}} = \rho _{0} &+ [it\mu O_{j}, \rho _{0} ] + \frac {1}{2!} \bigl[it\mu O_{j}, [it\mu O_{j}, \rho _{0} ] \bigr] + \cdots . \end{aligned}$$

Subtracting Eq. (35) from Eq. (34) yields

$$\begin{aligned} & \bigl[e^{-it\mu O_{j}}\rho _{0}e^{it\mu O_{j}} - e^{it\mu O_{j}}\rho _{0}e^{-it \mu O_{j}} \bigr] \\ &\quad =-2i\frac {t\mu}{1!} [O_{j},\rho _{0} ] +2i \frac {(t\mu )^{3}}{3!} \bigl[O_{j}, \bigl[O_{j}, [O_{j},\rho _{0} ] \bigr] \bigr] -2i\frac {(t\mu )^{5}}{5!} \cdots, \end{aligned}$$

where using the algebraic expansion with the condition \(O_{j}^{2} = \boldsymbol{I}\), we have \([O_{j}, [O_{j}, [O_{j},\rho _{0} ] ] ] = \frac {2^{3}}{2} [O_{j},\rho _{0} ]\), and so on. Finally, Eq. (36) becomes

$$\begin{aligned} \bigl[e^{-it\mu O_{j}}\rho _{0}e^{it\mu O_{j}} - e^{it\mu O_{j}}\rho _{0}e^{-it \mu O_{j}} \bigr] = -i\sin (2t\mu ) [O_{j},\rho _{0} ]. \end{aligned}$$

Multiplying two sides of Eq. (37) by \(\frac{i}{\sin (2t\mu )}\) we arrive at Eq. (33)

Now, substituting Eq. (33) into Eq. (32), we have

$$\begin{aligned} \frac {\partial \rho (\boldsymbol{\phi} )}{ \partial \phi _{j}} = \frac {1}{\sin (2t\mu )} \int _{0}^{t} U( \boldsymbol{\phi} ) \bigl[e^{-it\mu O_{j}}\rho _{0}e^{it\mu O_{j}} - e^{it\mu O_{j}} \rho _{0}e^{-it\mu O_{j}} \bigr] U^{\dagger}(\boldsymbol{\phi} ) \,ds. \end{aligned}$$

Using \(e^{-it\mu O_{j}} = e^{isH(\boldsymbol{\phi} )} e^{-it\mu [\partial _{ \phi _{j}} H(\boldsymbol{\phi} ) ]} e^{-isH(\boldsymbol{\phi} )} \) and \(U(\boldsymbol{\phi} ) = e^{-itH(\boldsymbol{\phi} )}\), we set

$$\begin{aligned} U_{j}^{\pm}(\boldsymbol{\phi} ,s) &= U(\boldsymbol{\phi} )e^{\mp it\mu O_{j}} \\ &= e^{-itH(\boldsymbol{\phi} )} e^{isH(\boldsymbol{\phi} )} e^{\mp it\mu [\partial _{ \phi _{j}} H(\boldsymbol{\phi} ) ]} e^{-isH(\boldsymbol{\phi} )} \\ & = e^{-i(t-s)H(\boldsymbol{\phi} )} e^{\mp it\mu [\partial _{\phi _{j}} H( \boldsymbol{\phi} ) ]} e^{-isH(\boldsymbol{\phi} )}. \end{aligned}$$

Substituting Eq. (39) into Eq. (38), we obtain

$$\begin{aligned} \frac {\partial \rho (\boldsymbol{\phi} )}{ \partial \phi _{j}} &= \frac {1}{\sin (2t\mu )} \int _{0}^{t} \bigl[U_{j}^{+}( \boldsymbol{\phi} ,s) \rho _{0} \bigl[U_{j}^{+}( \boldsymbol{\phi} ,s) \bigr]^{\dagger }-U_{j}^{-}( \boldsymbol{\phi} ,s) \rho _{0} \bigl[U_{j}^{-}( \boldsymbol{\phi} ,s) \bigr]^{\dagger} \bigr] \,ds \\ & = \frac {1}{\sin (2t\mu )} \int _{0}^{t} \bigl[ \rho _{j}^{+}( \boldsymbol{\phi} ,s) - \rho _{j}^{-}(\boldsymbol{\phi} ,s) \bigr] \,ds, \end{aligned}$$

where we used \(\rho _{j}^{\pm}(\boldsymbol{\phi} ,s) = U_{j}^{\pm}(\boldsymbol{\phi} ,s)\rho _{0} [U_{j}^{ \pm}(\boldsymbol{\phi} ) ]^{\dagger} \). □

4.2 Theoretical analysis for single-parameter estimation

Firstly, let us discuss the exact calculation method for quantum Fisher information in single parameter estimation. Starting from \(H(\phi ) = \cos (\phi )\sigma _{x} + \sin (\phi )\sigma _{z}\), we derive \(\partial _{\phi }H(\phi ) = -\sin (\phi )\sigma _{x} + \cos (\phi ) \sigma _{z}\). Substituting it into \(Y_{j}\) for \(j = \phi \), we obtain

$$\begin{aligned} Y_{\phi }&= \int _{0}^{t} e^{isH(\phi )} \bigl[\partial _{\phi} H(\phi ) \bigr]e^{-isH(\phi )} \,\mathrm{d}s \\ & = \frac {1}{2} \begin{pmatrix} \sin 2t\cos \phi & -\sin 2t\sin \phi - 2i\sin ^{2}t \\ -\sin 2t\sin \phi + 2i\sin ^{2}t & -\sin 2t\cos \phi \end{pmatrix}. \end{aligned}$$

Finally, we derive the quantum Fisher information as in Eq. (7):

$$\begin{aligned} Q(\phi ) &=4\operatorname{Re} \bigl[ \bigl\langle \psi _{0} \bigl\vert Y_{\phi}^{2} \bigr\vert \psi _{0} \bigr\rangle - \vert \bigl\langle \psi _{0} \vert Y_{\phi} \vert \psi _{0}\bigr\rangle \vert ^{2} \bigr] \\ & = 4\sin ^{2}(t) \bigl[1-\cos ^{2}(t)\sin ^{2}( \phi ) \bigr], \end{aligned}$$

which results in Eq. (15).

4.3 Trotter-Suzuki transformation and Stand.PSR

From now on, let us show the detailed calculation for the Trotter-Suzuki transformation and Stand.PSR for single parameter estimation. From the evolution (21), we set

$$\begin{aligned} \textstyle\begin{cases} x = \frac{2t}{m}\cos (\phi ), \\ z = \frac{2t}{m}\sin (\phi ) \end{cases}\displaystyle \quad \Rightarrow \quad \textstyle\begin{cases} \partial _{\phi }x = -\frac{2t}{m}\sin (\phi ), \\ \partial _{\phi }z = \frac{2t}{m}\cos (\phi ). \end{cases}\displaystyle \end{aligned}$$

Then, Eq. (21) is recast as

$$\begin{aligned} U(x,z) = \lim_{m\to \infty} \bigl(e^{-i\frac{x}{2}\sigma _{x}} e^{-i \frac{z}{2}\sigma _{z}} \bigr)^{m}, \end{aligned}$$

and thus

$$\begin{aligned} \partial _{\phi }U(x,z) = \frac {\partial U(x,z)}{\partial x} \frac {\partial x}{\partial \phi} + \frac {\partial U(x,z)}{\partial z} \frac {\partial z}{\partial \phi}. \end{aligned}$$

Concretely, we have

$$\begin{aligned} &\partial _{x} U(x,z)= \frac {m}{2}(-i\sigma _{x})U(x,z), \end{aligned}$$
$$\begin{aligned} &\partial _{z} U(x,z)= \frac {m}{2}(-i\sigma _{z})U(x,z). \end{aligned}$$

Note that \(U(\pi ,0) = \lim_{m\to \infty}(-i\sigma _{x})^{m}\). For \(m = 4k+1\ \forall k\in \mathbb{N}\), we have \(U(\pi ,0) = -i\sigma _{x}\), from which the Pauli matrix \(\sigma _{x}\) can be implemented by the unitary (quantum gate) \(U(\pi ,0)\). Likewise, \(U(0,z+\pi ) = -i\sigma _{z}\). Now, Eqs. (45), (46) are recast as

$$\begin{aligned} &\partial _{x} U(x,z) = \frac {m}{2}U(x+\pi ,z), \end{aligned}$$
$$\begin{aligned} &\partial _{z} U(x,z) = \frac {m}{2}U(x,z+\pi ). \end{aligned}$$

Here, m obeys the periodic property, therefore its choice will not affect the results. Hence, these derivatives (47), (48) can be obtained in quantum circuits by modifying the Stand.PRS. Substituting Eqs. (47), (48) and Eq. (42) into Eq. (44), we derive

$$\begin{aligned} \partial _{\phi}\big|\psi (\phi )\big\rangle &=\partial _{\phi }U(x,z)|\psi _{0} \rangle \\ &=t \bigl[-\sin (\phi )U(x+\pi ,z) +\cos (\phi )U(x,z+\pi ) \bigr] |\psi _{0} \rangle , \end{aligned}$$

where \(|\psi _{0}\rangle \) is the initial probe state. In this form, the QFI is given as

$$\begin{aligned} Q(\phi ) &= 4\operatorname{Re} \bigl[\bigl\langle \partial _{\phi}\psi (\phi ) \bigl\vert \partial _{\phi}\psi (\phi ) \bigr\rangle - \bigr\vert \bigl\langle \partial _{\phi}\psi ( \phi ) \bigl\vert \psi (\phi )\bigr\rangle \bigr\vert ^{2} \bigr]. \end{aligned}$$

The procedure for calculating the quantum Fisher information is shown in Algorithm 2.

Algorithm 2
figure b

Standard parameter-shift rule

4.4 Multiple parameters estimation

Hereafter, we derive the multiple parameters estimation. For \(n = 3\), we first calculate \(J_{j}\) for \(j = \{x, y, z\}\) as

$$\begin{aligned} J_{j} = \sigma _{j}\otimes I_{2} \otimes I_{2} + I_{2} \otimes \sigma _{j}\otimes I_{2} + I_{2} \otimes I_{2} \otimes \sigma _{j}, \end{aligned}$$

where \(I_{2}\) is the \(2\times 2\) identity matrix. The Hamiltonian \(H(\boldsymbol{\phi} )\) is given by Eq. (22), and its derivative yields \(\partial _{\phi _{j}}H(\boldsymbol{\phi} ) = J_{j}\). Similar to the above, we derive \(Y_{j}\)

$$\begin{aligned} Y_{j} &= \int _{0}^{t} e^{isH(\boldsymbol{\phi} )}J_{j}e^{-isH(\boldsymbol{\phi} )} \,\mathrm{d}s, \end{aligned}$$

and obtain the quantum Fisher information matrix from Eq. (8).

Availability of data and materials

Not applicable.



Standard parameter-shift rule


Stochastic parameter-shift rule


Quantum Fisher information


Quantum Fisher information matrix


Classical Fisher information


Classical Fisher information matrix


Positive operator-valued measure


Cramér-Rao bound


Symmetric logarithmic derivative


Mean-square error


Nuclear magnetic resonance




Symmetric, informationally complete, positive operator-valued measure


Standard quantum limit


Heisenberg limit


  1. Chalopin T, Bouazza C, Evrard A, Makhalov V, Dreon D, Dalibard J, Sidorenkov LA, Nascimbene S. Quantum-enhanced sensing using non-classical spin states of a highly magnetic atom. Nat Commun. 2018;9(1):4955.

    Article  ADS  Google Scholar 

  2. Pezzè L, Smerzi A, Oberthaler MK, Schmied R, Treutlein P. Quantum metrology with nonclassical states of atomic ensembles. Rev Mod Phys. 2018;90:035005.

    Article  ADS  MathSciNet  Google Scholar 

  3. Pezzé L, Smerzi A. Entanglement, nonlinear dynamics, and the Heisenberg limit. Phys Rev Lett. 2009;102:100401.

    Article  ADS  MathSciNet  Google Scholar 

  4. Huelga SF, Macchiavello C, Pellizzari T, Ekert AK, Plenio MB, Cirac JI. Improvement of frequency standards with quantum entanglement. Phys Rev Lett. 1997;79:3865–8.

    Article  ADS  Google Scholar 

  5. Giovannetti V, Lloyd S, Maccone L. Quantum-enhanced measurements: beating the standard quantum limit. Science. 2004;306(5700):1330–6.

    Article  ADS  Google Scholar 

  6. Giovannetti V, Lloyd S, Maccone L. Quantum metrology. Phys Rev Lett. 2006;96:010401.

    Article  ADS  MathSciNet  Google Scholar 

  7. Ho LB, Hakoshima H, Matsuzaki Y, Matsuzaki M, Kondo Y. Multiparameter quantum estimation under dephasing noise. Phys Rev A. 2020;102:022602.

    Article  ADS  Google Scholar 

  8. Ho LB, Kondo Y. Multiparameter quantum metrology with postselection measurements. J Math Phys. 2021;62(1):012102.

    Article  ADS  MathSciNet  MATH  Google Scholar 

  9. Ho LB, Matsuzaki Y, Matsuzaki M, Kondo Y. Nuclear magnetic resonance model of an entangled sensor under noise. J Phys Soc Jpn. 2020;89(5):054001.

    Article  ADS  Google Scholar 

  10. Wineland DJ, Bollinger JJ, Itano WM, Moore FL, Heinzen DJ. Spin squeezing and reduced quantum noise in spectroscopy. Phys Rev A. 1992;46:6797–800.

    Article  ADS  Google Scholar 

  11. Wineland DJ, Bollinger JJ, Itano WM, Heinzen DJ. Squeezed atomic states and projection noise in spectroscopy. Phys Rev A. 1994;50:67–88.

    Article  ADS  Google Scholar 

  12. Ho LB, Kondo Y. Modular-value-based metrology with spin coherent pointers. Phys Lett A. 2019;383(2):153–7.

    Article  ADS  Google Scholar 

  13. Paris MGA. Quantum estimation for quantum technology. Int J Quantum Inf. 2009;07(supp01):125–37.

    Article  MATH  Google Scholar 

  14. Liu J, Yuan H, Lu X-M, Wang X. Quantum Fisher information matrix and multiparameter estimation. J Phys A, Math Theor. 2019;53(2):023001.

    Article  ADS  MathSciNet  MATH  Google Scholar 

  15. Pang S, Brun TA. Quantum metrology for a general Hamiltonian parameter. Phys Rev A. 2014;90:022117.

    Article  ADS  Google Scholar 

  16. Baumgratz T, Datta A. Quantum enhanced estimation of a multidimensional field. Phys Rev Lett. 2016;116:030801.

    Article  ADS  MATH  Google Scholar 

  17. Liu J, Jing X-X, Wang X. Quantum metrology with unitary parametrization processes. Sci Rep. 2015;5(1):8565.

    Article  Google Scholar 

  18. Jing X-X, Liu J, Xiong H-N, Wang X. Maximal quantum Fisher information for general su(2) parametrization processes. Phys Rev A. 2015;92:012312.

    Article  ADS  Google Scholar 

  19. Yuan H, Fung C-HF. Optimal feedback scheme and universal time scaling for Hamiltonian parameter estimation. Phys Rev Lett. 2015;115:110401.

    Article  ADS  Google Scholar 

  20. Pang S, Jordan AN. Optimal adaptive control for quantum metrology with time-dependent Hamiltonians. Nat Commun. 2017;8(1):14695.

    Article  ADS  Google Scholar 

  21. Arute F et al.. Quantum supremacy using a programmable superconducting processor. Nature. 2019;574(7779):505–10.

    Article  ADS  Google Scholar 

  22. Zhong H-S et al.. Quantum computational advantage using photons. Science. 2020;370(6523):1460–3.

    Article  ADS  Google Scholar 

  23. Preskill J. Quantum computing in the NISQ era and beyond. Quantum. 2018;2:79.

    Article  Google Scholar 

  24. Cerezo M, Arrasmith A, Babbush R, Benjamin SC, Endo S, Fujii K, McClean JR, Mitarai K, Yuan X, Cincio L, Coles PJ. Variational quantum algorithms. Nat Rev Phys. 2021;3(9):625–44.

    Article  Google Scholar 

  25. Montanaro A. Quantum algorithms: an overview. npj Quantum Inf. 2016;2(1):15023.

    Article  ADS  Google Scholar 

  26. Peruzzo A, McClean J, Shadbolt P, Yung M-H, Zhou X-Q, Love PJ, Aspuru-Guzik A, O’Brien JL. A variational eigenvalue solver on a photonic quantum processor. Nat Commun. 2014;5(1):4213.

    Article  ADS  Google Scholar 

  27. Nakanishi KM, Mitarai K, Fujii K. Subspace-search variational quantum eigensolver for excited states. Phys Rev Res. 2019;1:033062.

    Article  Google Scholar 

  28. Tkachenko NV, Sud J, Zhang Y, Tretiak S, Anisimov PM, Arrasmith AT, Coles PJ, Cincio L, Dub PA. Correlation-informed permutation of qubits for reducing ansatz depth in the variational quantum eigensolver. PRX Quantum. 2021;2:020337.

    Article  ADS  Google Scholar 

  29. Zhou L, Wang S-T, Choi S, Pichler H, Lukin MD. Quantum approximate optimization algorithm: performance, mechanism, and implementation on near-term devices. Phys Rev X. 2020;10:021067.

    Article  Google Scholar 

  30. Arrasmith A, Cincio L, Sornborger AT, Zurek WH, Coles PJ. Variational consistent histories as a hybrid algorithm for quantum foundations. Nat Commun. 2019;10(1):3438.

    Article  ADS  Google Scholar 

  31. Koczor B, Endo S, Jones T, Matsuzaki Y, Benjamin SC. Variational-state quantum metrology. New J Phys. 2020;22(8):083038.

    Article  MathSciNet  Google Scholar 

  32. Meyer JJ, Borregaard J, Eisert J. A variational toolbox for quantum multi-parameter estimation. npj Quantum Inf. 2021;7(1):89.

    Article  ADS  Google Scholar 

  33. Mitarai K, Negoro M, Kitagawa M, Fujii K. Quantum circuit learning. Phys Rev A. 2018;98:032309.

    Article  ADS  Google Scholar 

  34. Schuld M, Bergholm V, Gogolin C, Izaac J, Killoran N. Evaluating analytic gradients on quantum hardware. Phys Rev A. 2019;99:032331.

    Article  ADS  Google Scholar 

  35. Stokes J, Izaac J, Killoran N, Carleo G. Quantum natural gradient. Quantum. 2020;4:269.

    Article  Google Scholar 

  36. Childs AM, Wiebe N. Hamiltonian simulation using linear combinations of unitary operations. Quantum Inf Comput. 2012;12:901–24.

    Article  MathSciNet  MATH  Google Scholar 

  37. Banchi L, Crooks GE. Measuring analytic gradients of general quantum evolution with the stochastic parameter shift rule. Quantum. 2021;5:386.

    Article  Google Scholar 

  38. Kaubruegger R, Silvi P, Kokail C, van Bijnen R, Rey AM, Ye J, Kaufman AM, Zoller P. Variational spin-squeezing algorithms on programmable quantum sensors. Phys Rev Lett. 2019;123:260505.

    Article  ADS  Google Scholar 

  39. Le TK, Nguyen HQ, Ho LB. Variational quantum metrology for multiparameter estimation under dephasing noise. 2023. arXiv:2305.08289.

  40. Meyer JJ. Fisher information in noisy intermediate-scale quantum applications. Quantum. 2021;5:539.

    Article  Google Scholar 

  41. Beckey JL, Cerezo M, Sone A, Coles PJ. Variational quantum algorithm for estimating the quantum Fisher information. Phys Rev Res. 2022;4:013083.

    Article  Google Scholar 

  42. Wilcox RM. Exponential operators and parameter differentiation in quantum physics. J Math Phys. 1967;8(4):962–82.

    Article  ADS  MathSciNet  MATH  Google Scholar 

  43. Achilles R, Bonfiglioli A. The early proofs of the theorem of Campbell, Baker, Hausdorff, and Dynkin. Arch Hist Exact Sci. 2012;66(3):295–358.

    Article  MathSciNet  MATH  Google Scholar 

  44. Mari A, Bromley TR, Killoran N. Estimating the gradient and higher-order derivatives on quantum hardware. Phys Rev A. 2021;103:012405.

    Article  ADS  MathSciNet  Google Scholar 

  45. Li H-S, Xu Y, Qin Y, Fu D, Xia H-Y. The addition and subtraction of quantum matrix based on GNEQR. Int J Quantum Inf. 2019;17(7):1950056.

    Article  MathSciNet  MATH  Google Scholar 

  46. Viet NT, Chuong NT, Huyen VTN, Ho LB. Tqix.pis: a toolbox for quantum dynamics simulation of spin ensembles in Dicke basis. Comput Phys Commun. 2023;286:108686.

    Article  MATH  Google Scholar 

  47. Dhand I, Sanders BC. Stability of the Trotter–Suzuki decomposition. J Phys A, Math Theor. 2014;47(26):265206.

    Article  ADS  MathSciNet  MATH  Google Scholar 

  48. Ma R, Owens C, LaChapelle A, Schuster DI, Simon J. Hamiltonian tomography of photonic lattices. Phys Rev A. 2017;95:062120.

    Article  ADS  Google Scholar 

  49. Wang S-T, Deng D-L, Duan L-M. Hamiltonian tomography for quantum many-body systems with arbitrary couplings. New J Phys. 2015;17(9):093017.

    Article  MATH  Google Scholar 

  50. Wiebe N, Granade C, Ferrie C, Cory DG. Hamiltonian learning and certification using quantum resources. Phys Rev Lett. 2014;112:190501.

    Article  ADS  Google Scholar 

  51. Di Franco C, Paternostro M, Kim MS. Hamiltonian tomography in an access-limited setting without state initialization. Phys Rev Lett. 2009;102:187203.

    Article  ADS  Google Scholar 

  52. Li Z, Zou L, Hsieh TH. Hamiltonian tomography via quantum quench. Phys Rev Lett. 2020;124:160502.

    Article  ADS  Google Scholar 

  53. Czerwinski A. Hamiltonian tomography by the quantum quench protocol with random noise. Phys Rev A. 2021;104:052431.

    Article  ADS  MathSciNet  Google Scholar 

Download references


This work is supported by JSPS KAKENHI Grant Number 23K13025.


Japan Society for the Promotion of Science (JSPS) KAKENHI, 23K13025.

Author information

Authors and Affiliations



The sole author carried out all the calculations and wrote the manuscript.

Corresponding author

Correspondence to Le Bin Ho.

Ethics declarations

Ethics approval and consent to participate

Not applicable.

Consent for publication

Not applicable.

Competing interests

The authors declare no competing interests.

Additional information

Publisher’s Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Ho, L.B. A stochastic evaluation of quantum Fisher information matrix with generic Hamiltonians. EPJ Quantum Technol. 10, 37 (2023).

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: