
moments of the observable and generalized bounds. Weber et
al. [
15
] establsih a link between binary quantum hypothesis
testing and provably robust QNNs, resulting in a robustness
condition for the amount of noise a classifier can tolerate. Du
et al. [
16
] finds that the depolarization noise in QNNs helps
derive a robustness bound, where the robustness improves with
increasing noise.
2. BACKGROUND KNOWLEDGE
Quantum Classifier
Parameterized quantum circuits are quan-
tum frameworks that depend on trainable parameters, and can
therefore be optimized [
22
]. Variational quantum classifier al-
gorithm is under this framework, being the predominant basis
of quantum classifiers. Several optimization methods are de-
veloped and different quantum classifiers are proposed. In our
work, we use the optimization method called parameter-shift
rule [
12
]. That is, the output of a variational quantum circuit,
denoted by f(θ), is parameterized by θ=θ1, θ2, . . . .
To optimize
θ
, we need to acquire the partial derivative of
f(θ)
which can be expressed as a linear combination of other
quantum functions, typically derived from the same circuit
with a shift of
θ
. That is, the same variational quantum circuit
can be used to compute the partial derivatives of
f(θ)
. Besides,
we need to encode our classical data and int this aspect we
adopt the amplitude encoding method [
23
,
24
] . To encode
data efficiently, amplitude encoding is to transform classical
data into linear combination of independent quantum states
with the magnitudes of features being the weights which can
be expressed as
Sx|0i=1
|x|P2n
n=1 xi|ii
, where each
xi
is
a feature (component) of data point
x
, and
|ii
is a basis of
n
-qubit space. In our work, we assume a
K
-class quantum
classifier of which the output is the predicted label of the input
state.
Let
Πk
be a positive operator-valued measure (POVM)
and
E
be quantum operations of the quantum classifier. Define
yk(σ)≡T r(ΠkE(σ⊗ |aiha|))
which denotes the probabil-
ity with which input state
σ
is assigned to the label
k, k ∈
0,1,2, ...., K −1.
and
∼
yk(σ) = T r(ΠkE(Rσ ⊗ |aiha|))
which denotes the probability with which input state
σ
is
assigned to the label
k, k ∈0,1,2, ...., K −1
under noise,
where
R
is the noise operator. Since it is impossible to derive
actual
yk(σ)
and
∼
yk(σ)
, we sample N times to estimate
yk
and
∼
yk
with
y(N)
k(σ)
and
∼
yk
(N)(σ)
, respectively. In our work,
we assume
K= 2
(binary classification) for convenience
but similar reasoning can also be applied in the multiclass
scenario.
Quantum Differential Privacy
Similar to classical
-
differential privacy, we adopt the quantum version of
-
differential privacy from [
25
]. Furthermore, we express a
quantum classifier under
K
-class classification problem to
have satisfied -differential privacy if the following holds.
Let
be a positive real number and
M
be a quantum
algorithm that takes a quantum state as input. The al-
gorithm
M
is said to provide quantum
-differential pri-
vacy if, for all input quantum states
σ
and
ρ
such that
τ(σ, ρ)< τD
, and for all
Πi, i ∈0,1,2,3..., K −1
, we
have
Pr[M(σ, Πi)] ≤exp ()·Pr[M(ρ, Πi)]
, and therefore
e−≤
∼
yk(ρ)
∼
yk(σ)≤e.
3. PROPOSED METHOD
We begin with the idea of simulating randomized smoothing
in quantum machine learning. We aim to add perturbation
on qubits and consider random rotations on the Bloch sphere
as a counterpart of randomized smoothing. Then, we apply
rotation gates, as shown in Fig. 1, on each input qubit and
set up rotation angles with random variables generated from
classical computers.
Fig. 1: The rotation circuit with output density matrix (σ).
Our proposed method is summarized in Algorithm 1. Our
method does not assume details of quantum classifiers, and
thus is general for model agnostic. Our method guarantees the
accuracy of original quantum classifiers, and the corresponding
robustness bound is also applicable for all kinds of quantum
classifiers. Further analysis of Algorithm 1 is also proven in
subsequent section.
Algorithm 1 Quantum model under quantum noise rotation
Input σ: where σis density matrix of n-dim data.
Output f(θ∗, σ)
1. For a chosen quantum classifier, add Pauli-X operators
before each input qubit.
2. Generate n random variables
θ1, θ2, ..., θn
subject to
0< h1<tan θi< h2for all i∈ {1,2, . . . , n}.
3. Set up rotation angles of additional Pauli-X operators
with θ1, θ2, ..., θn
4. Execute the quantum classifier
N
times to get the score
vector f(θ∗, σ).
4. THEORETICAL ANALYSIS
Our goal is to demonstrate that random rotation noises can
be used to protect quantum classifiers against adversarial per-
turbations. This can be divided into three main steps. We
first show the invariance of outcomes between noisy classifiers
and original ones. Then we demonstrate how random rotation
noises improve quantum differential privacy for the classi-
fiers. Ultimately, we can show the connection between the
differential privacy and the better robustness against general
adversaries of classifiers.