
2
tum physics, endowed with distinct meanings in different
fields of physics [44], such as the overlap integral of two
states, matrix elements of an operator, scattering ampli-
tudes, and the Green’s function or Feynman propagator
in quantum field theory. Since direct measurement of
them is outside of the conventional formalism, e.g., the
projective (von Neumann) measurement [45], some in-
direct methods have been proposed, such as the swap
test [46], weak measurement [47], and quantum circuits
for simulating the correlation function [48–50]. However,
these proposals are still only valid for specific situations;
that is, |ψ1,2icannot be arbitrary. A general scheme for
measuring generalized expectations remains to be settled
even in broader fields of quantum physics.
To deal with the measurement of hψ1|A|ψ2i, we pro-
pose a general circuit based on the swap test [46] in Fig.
1to directly capture the real and imaginary parts of the
generalized expectation. Meanwhile, to apply the gen-
eral circuit to hψL|A|ψRiin non-Hermitian systems, a
quantum circuit (Fig. 2) for efficiently preparing the dual
eigenstates of a given non-Hermitian Hamiltonian as the
input of the general circuit is also developed with the aid
of the dilation method [31]. By numerically simulating
these circuits in the nonreciprocal SSH model, we suc-
cessfully obtain the Bloch and non-Bloch spin textures
and the corresponding winding numbers under periodic
and open boundary conditions (PBCs and OBCs), re-
spectively, which demonstrates the validity of our cir-
cuits.
The paper is organized as follows. The general quan-
tum circuit for measuring generalized expectations is pro-
posed in Sec. II. Specially for non-Hermitian systems, the
quantum circuit for preparing the dual eigenstates of a
non-Hermitian Hamiltonian is developed in Sec. III. In
Sec. IV, we apply these circuits to the non-reciprocal
SSH model and numerically simulate the measurement
of Bloch and non-Bloch spin textures and the winding
numbers. Section Vprovides a conclusion.
II. A GENERAL MEASURMENT CIRCUIT FOR
GENERALIZED EXPECTATIONS
Our aim is to measure the quantity, hψ1|A|ψ2i, of an
arbitrary operator Awith respect to two quantum states
|ψ1iand |ψ2i, dubbed a generalized expectation of A,
which reduces to the conventional expectation when the
two states are identical, i.e., |ψ1i=|ψ2i. Because any
operator can be decomposed into Hermitian operators,
A=A+A†
2+iA−A†
2i, we just need to propose a
quantum circuit to measure the generalized expectation
of a Hermitian operator, i.e., hψ1|O|ψ2i, where Orepre-
sents an experimentally accessible, Hermitian operator.
Figure 1shows the quantum circuit for measuring
hψ1|O|ψ2i, which is the main result of this paper. Sup-
posing that |ψ1,2iare obtained, this circuit consists of
systems A and B, each of which is represented by n
qubits, and an ancilla qubit. Firstly, the two states |ψ1,2i
system A: |ψ1⟩
system B: |ψ2⟩
ancilla: |0⟩
|Ψ0⟩
H
|Ψ1⟩ |Ψ2⟩
O
O′
σx,y
Input Operation Readout
FIG. 1. The general quantum circuit for measuring the gen-
eralized expectation hψ1|O|ψ2iscaled by hψ1|O0|ψ2i. Two
quantum states |ψ1,2iare assumed to be prepared by other
methods as input in systems A and B, respectively, each of
which consists of nqubits. The ancilla qubit is initialized to
|0i. The successive operations include a Hadamard gate (de-
noted by H) on the ancilla and a controlled-swap (Fredkin)
gate with the ancilla as the control qubit. Oand O0denote
the experimentally accessible Hermitian operators. σx,y are
two operators of Pauli matrices. The details of the readout
process are given in Appendix B.
are put into systems A and B, respectively, and the an-
cilla qubit is initialized to |0i, yielding a product state
|Ψ0i=|ψ1i⊗|ψ2i⊗|0i(1)
as an initial state.
Secondly, by applying a Hadamard gate to the ancilla,
and then a controlled-swap (Fredkin) gate with the an-
cilla being the control qubit, we obtain successively
|Ψ1i=|ψ1i⊗|ψ2i ⊗ 1
√2(|0i+|1i),(2)
|Ψ2i=1
√2(|ψ1i⊗|ψ2i⊗|0i+|ψ2i⊗|ψ1i⊗|1i).(3)
Finally, the operator Oand an ancillary Hermitian
operator O0are introduced to systems A and B, respec-
tively. Because of the Hermiticity of Oand O0, we obtain
the following relations (see Appendix Afor the detailed
derivation):
hΨ2|O⊗O0⊗σx|Ψ2i
hΨ2|O0⊗O0⊗σx|Ψ2i= Re hψ1|O|ψ2i
hψ1|O0|ψ2i,
hΨ2|O⊗O0⊗σy|Ψ2i
hΨ2|O0⊗O0⊗σx|Ψ2i= Im hψ1|O|ψ2i
hψ1|O0|ψ2i,
(4)
where σx,y are two operators of Pauli matrices. Assum-
ing that Oand O0are experimentally accessible, from
Eq. (4) the generalized expectation hψ1|O|ψ2iscaled by
hψ1|O0|ψ2i 6= 0 can be figured out by measuring the tra-
ditional expectations [left-hand side of Eq. (4)] in ex-
periment. Based on current experiment scales [51], this
general measurement quantum circuit in Fig. 1can be
applied to the qubit systems with states and operators
being composed of up to ∼50 qubits of each. See Ap-
pendix Bfor details of the measurement.
For convenience, O0can be set as an identity opera-
tor, and the scaling factor hψ1|O0|ψ2ireduces to hψ1|ψ2i,