# Robust certification of arbitrary outcome quantum measurements from temporal
correlations

Debarshi Das<EMAIL_ADDRESS>S. N. Bose National Centre for Basic
Sciences, Block JD, Sector III, Salt Lake, Kolkata 700106, India  Ananda G.
Maity<EMAIL_ADDRESS>S. N. Bose National Centre for Basic Sciences,
Block JD, Sector III, Salt Lake, Kolkata 700106, India  Debashis Saha
<EMAIL_ADDRESS>S. N. Bose National Centre for Basic Sciences, Block JD,
Sector III, Salt Lake, Kolkata 700106, India  A. S. Majumdar
<EMAIL_ADDRESS>S. N. Bose National Centre for Basic Sciences, Block JD,
Sector III, Salt Lake, Kolkata 700106, India

###### Abstract

Certification of quantum devices received from unknown providers is a primary
requirement before utilizing the devices for any information processing task.
Here, we establish a protocol for certification of $d$-outcome quantum
measurements (with $d$ being arbitrary) in a setup comprising of a preparation
followed by two measurements in sequence. We propose a set of temporal
inequalities pertaining to different $d$ involving correlation functions
corresponding to successive measurement outcomes, that are not satisfied by
quantum devices. Using quantum violations of these inequalities, we certify
$d$-outcome measurements under some minimal assumptions which can be met in an
experiment efficiently. Our certification protocol neither requires
entanglement, nor any prior knowledge about the dimension of the system under
consideration. We further show that our protocol is robust against realistic
non-ideal realization. Finally, as an offshoot of our protocol, we present a
scheme for secure certification of genuine quantum randomness.

##  I Introduction

With the rapid development of quantum information science along with its
multi-faceted applications in communication and cryptographic protocols,
guaranteeing the functioning of quantum devices received from untrusted
providers becomes one of the basic requirements for modern quantum
technologies. The task of ensuring the proper functioning of the quantum
devices can be designed by utilizing the intrinsic features of quantum physics
through certification or verification protocols. Several certification
protocols have been designed till date with the desiderata of efficiency,
security and less resource consumption. Tomography Tomo1 ; Tomo2 ; Tomo3 ,
randomized benchmarking RB1 ; RB2 ; RB3 ; Eisert_review  and self-testing
my'98 ; my'04 ; Supic_review  are notable among them.

Tomography is one of the foremost traditional methodologies for characterizing
unknown quantum preparations, measurements, or processes Tomo1 ; Tomo2 ; Tomo3
. However, from an operational perspective, wherein a set of unknown quantum
devices are intended to perform information processing or computational tasks,
quantum tomography is inadequate. In order to carry out tomography of an
unknown quantum device, one first needs to know the dimension as well as the
relevant degrees of freedom of the physical system that comprises the device,
and accordingly, some other fully characterized quantum devices are essential.
For instance, for the tomography of an unknown two-outcome qubit measurement,
at least three completely known qubit preparations are required. Therefore,
tomography of quantum state preparation, process or measurement is a rather
resource consuming method. A similar but less resource consuming method is
randomized benchmarking which aims to characterize gate errors in an efficient
and robust way in terms of the average overlap between the physical quantum
states, measurements or processes and their ideal counterparts Eisert_review .

Motivated by certain key features of quantum information theory, other
ingenious certification methods have been introduced in recent years. These
certifications rely upon various non-classical correlations observed only from
the statistics that the devices generate. Moreover, these methods do not
require full characterization of any of the devices and, hence, are
categorized as device-independent certification protocols. In a fully device-
independent scenario, all involved devices are considered as black boxes, thus
requiring minimal assumptions on the underlying states and measurements. On
the other hand, in a semi device-independent scenario, some assumptions on the
devices are required. Apart from their fundamental interests, these
certifications have been shown to be immensely useful in many information
processing tasks, like quantum key distribution Acin'07 , secure randomness
expansion Pironio'10 , quantum computation Vazirani , and so on.

The most complete form of device-independent certification, namely, self-
testing, employs entanglement and other non-local correlations. With the
requirement of space-like separated systems, self-testing provides the optimal
possible characterization of entangled systems and quantum measurements
without assuming any internal functioning of the devices. Historically, it was
first designed in order to certify certain maximally entangled two-qubit
states and non-commuting qubit measurements employing the maximum quantum
violation of the Bell-CHSH (Bell-Clauser-Horne-Shimony-Holt) inequality my'98
; my'04 . Since then, several other self-testing protocols have been proposed
McKague'12 ; Yang'13 ; Bamps'15 ; Col ; Wang'16 ; supic'18 .

Semi device-independent self-testing protocols have also been investigated
Supic'16 ; Goswami'18 ; peng'20 ; Shrotriya'20 ; Saha'21  employing Einstein-
Podolsky-Rosen steering. Moreover, semi device-independent certification for
prepare and measure scenarios have been studied tavakoli'18  with the
assumptions on the dimension of the underlying Hilbert space. Another class of
certification techniques introduced recently, relies on some features of the
measurement devices. Out of these, the ones exploiting quantum contextual
correlations presume repeatable measurements with certain compatibility
relations kishor'19 , or without any compatibility relations saha'20 .

Quantum measurements are one of the most important and key resource in quantum
technologies and play a crucial role to reveal the counter-intuitive quantum
advantages in non-classical phenomena. There are several protocols proposed
till date certifying various quantum measurements, but most of them either
require entanglement bancal'18 ; renou'18 ; kani'17 ; Mck ; Bowles'18 , a
costly resource, or need certain assumptions or trust on the measurement
devices to be certified tavakoli'18 ; Maity'21 . Certification of $d$-outcome
measurements (where $d$ is arbitrary) has received attention in a few works
Yang'13 ; Col  involving scenarios that require a large number of measurements
by each of the observers sharing the entangled state. Recently, certification
of $d$-outcome measurements has been proposed based on the Salavrakos-
Augusiak-Tura-Wittek-Aćin-Pironio (SATWAP) Bell inequality SATWAP , which
involves two measurements on both sides of the shared entangled state saha .
However, the above mentioned protocols require entanglement and, hence, space-
like separated systems. Therefore, a more efficient certification protocol
involving lesser resources and minimal assumptions for $d$-outcome
measurements is in order.

With the above motivation, here we aim to certify $d$-outcome measurements
(with $d$ being arbitrary) employing the non-classicality of temporal
correlations. We consider a scenario involving one preparation device and one
measurement device. The preparation device produces a maximally mixed state of
an arbitrary dimension on which the measurement device performs measurements
twice in sequence. In this scenario, we propose a set of temporal inequalities
(satisfied by classical devices) pertaining to different values of $d$,
containing time separated correlation functions corresponding to successive
measurement outcomes. Using quantum violations of these inequalities, we
certify $d$-outcome measurements without requiring entanglement or any prior
knowledge about the dimension of the system. Our scheme relies on certain
minimal assumptions that can be easily met in practice. We further show that
our protocol is robust against non-ideal realization. Our certification
protocol moreover enables us to formulate a scheme for genuine randomness
certification.

The rest of the paper is organised as follows. In the next Section, we first
present the scenario along with the required assumptions. We next propose a
criterion certifying that the measurements are projective. In Section III, we
provide our desired set of temporal inequalities along with their sum-of-
squares decompositions. In Section IV, we formulate our scheme for certifying
$d$-outcome measurements and its robustness analysis. Next, we demonstrate in
Section V the framework for secure randomness certification based on our
proposed certification protocol. Finally, Section VI is reserved for
concluding discussions along with some future perspectives.

##  II Scenario

Consider the scenario where at first a preparation device $\mathcal{P}$
prepares a state $\rho^{(\mathcal{P})}$ $\in$ $\mathbb{C}^{D}$ of an arbitrary
dimension $D$. This prepared state is then subjected to a measurement device
$\mathcal{M}$ that randomly performs measurement of one of the four possible
observables denoted by $A_{i}$ with $i\in\\{1,2,3,4\\}$. The post-measurement
state is again subjected to the same measurement device $\mathcal{M}$ that
randomly performs measurement of one of the four aforementioned observables.
The outcomes of the measurement of $A_{i}$ are denoted by $a_{i}$, where
$a_{i}\in\\{0,1,\cdots,d-1\\}$. The outcome statistics thus produced are the
joint probabilities $p(a_{i},a_{j}|A_{i}A_{j})$ with $i,j,\in\\{1,2,3,4\\}$
and $a_{i},a_{j}\in\\{0,1,\cdots,d-1\\}$. Here, $p(a_{i},a_{j}|A_{i}A_{j})$
denotes the joint probability of getting the outcome $a_{i}$ when the
measurement of $A_{i}$ is performed on the initially prepared state
$\rho^{(\mathcal{P})}$, and the outcome of $a_{j}$ when the measurement of
$A_{j}$ is performed on the post measurement state of $A_{i}$. This scenario
is depicted in Fig. 1.

###  II.1 Assumptions

We make the following two assumptions:

######  Assumption 1.

The preparation device $\mathcal{P}$ prepares the maximally mixed state
$\rho^{(\mathcal{P})}=\mathbbm{1}/D$, where the dimension $D$ is arbitrary.

######  Assumption 2.

The measurement device $\mathcal{M}$ always returns the actual post-
measurement state, and does not have any memory.

Assumption 1 is not really a speculation, but rather a maximally mixed state
can be prepared and verified in a real experiment. As we show later, such an
assumption on the preparation device is necessary, else the measurements
cannot be certified uniquely in our proposed scenario. Since, our motto is not
to certify the initial state prepared by the preparation device, we can assume
the preparation device to be trusted. A maximally mixed state can be prepared
efficiently in the laboratory. Nevertheless, once prepared, such a state
remains unaffected by environmental interactions. On the other hand,
assumption 2 is required since otherwise, any classical measurement system can
also simulate the desired quantum statistics.

Although this scenario for certification of measurements requires some
assumption on the preparation state and measurement device, it is efficient in
the sense that entanglement or other spatial correlations are not necessary
for this scheme.

Figure 1: The scenario involves a preparation device $\mathcal{P}$ and a
measurement device $\mathcal{M}$ with settings $A_{i}$ (where
$i\in\\{1,2,3,4\\}$) which returns outcome $a_{i}\in\\{0,1,\cdots,d-1\\}$. The
state prepared by $\mathcal{P}$ is subjected to $\mathcal{M}$ twice in
sequence.

###  II.2 Projectivity of the measurements

We would now like to present a lemma that introduces the operational criteria
for the measurements to be projective. Before proceeding, let us first define
the following probability distributions,

$\displaystyle p(a_{i}|A_{i})$
$\displaystyle=\sum_{a_{j}=0}^{d-1}p(a_{i},a_{j}|A_{i}A_{j})$
$\displaystyle\hskip 8.5359pt\forall a_{i}\in\\{0,\cdots
d-1\\},i,j\in\\{1,2,3,4\\}.$ (1)

Here, we have used the fact that the measurement of $A_{i}$ is performed at
first on the initial state. After that, the measurement of $A_{j}$ is
performed on the post-measurement state of $A_{i}$. This is why the
measurement of $A_{j}$ cannot influence the outcome statistics of the
measurement of $A_{i}$. Utilizing this fact, let us now present the following
Lemma,

######  Lemma 1.

For the initial state $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, if the following
condition is achieved

$p(a_{i},a_{i}|A_{i},A_{i})=p(a_{i}|A_{i})\,\,\,\,\forall\,\,a_{i}\in\\{0,1,\cdots,d-1\\},$
(2)

then the measurement of $A_{i}$ must be projective.

A thorough proof of the above Lemma can be found in the Appendix A. For the
sake of completeness, here we would like to sketch the outline of the proof.

In general, the measurement of $A_{i}$ can be taken as a POVM (Positive
Operator Valued Measurement) with
$A_{i}\equiv\\{M_{i}^{0},M_{i}^{1},\cdots,M_{i}^{d-1}\\}$. The general
condition for POVM implies that $M_{i}^{a_{i}}\geq 0$ for all
$a_{i}\in\\{0,1,\cdots,d-1\\}$ along with
$\sum\limits_{a_{i}=0}^{d-1}M_{i}^{a_{i}}=\mathbbm{1}$.

Without loss of generality, one can take
$M_{i}^{a_{i}}=\sum\limits_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}$
where $0<\lambda^{(a_{i})}_{x}\leq 1$ and
$\Big{\\{}\Big{|}\Psi^{(a_{i})}_{0}\Big{\rangle},\Big{|}\Psi^{(a_{i})}_{1}\Big{\rangle},\cdots,\Big{|}\Psi^{(a_{i})}_{D-1}\Big{\rangle}\Big{\\}}$
forms an orthonormal basis in $\mathbb{C}^{D}$ with $1\leq m\leq D$. However,
if the condition $p(a_{i},a_{i}|A_{i},A_{i})=p(a_{i}|A_{i})$ is achieved under
assumption 1, then a detailed calculation implies that
$\lambda^{(a_{i})}_{x}=1$ for all $x\in\\{0,1,\cdots,m-1\\}$ (see appendix A).
Therefore,
$M_{i}^{a_{i}}=\sum\limits_{x=0}^{m-1}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}$
and hence, $M_{i}^{a_{i}}$ must be a projector. Now, if the above condition
holds for all $a_{i}\in\\{0,1,\cdots,d-1\\}$, then the above argument implies
that the measurement of $A_{i}$ has to be projective.

Next, we will present a temporal inequality that will be used as a tool for
certifying $A_{1}$, $A_{2}$, $A_{3}$, $A_{4}$.

##  III Temporal Inequality with optimal quantum violation

Considering the scenario introduced in Section II, here we would like to
design a temporal inequality which can be used as a tool to certify $A_{1}$,
$A_{2}$, $A_{3}$, $A_{4}$ uniquely (up to some unitary). Nevertheless, it is
important to state here that this inequality can be used for probing non-
classicality of any preparation $\rho^{(\mathcal{P})}$ in the scenario
mentioned in section II, i.e., without considering the Assumption 1.

Consider now the two-dimensional Fourier transform of the conditional
probabilities $p(a_{i},a_{j}|A_{i},A_{j})$:

$\langle
A_{i}^{(k)}\,A_{j}^{(l)}\rangle=\sum_{a_{i},a_{j}=0}^{d-1}\omega^{a_{i}k+a_{j}l}p(a_{i},a_{j}|A_{i},A_{j}),$
(3)

where $\omega$ is the $d$-th root of unity i.e.,
$\omega=\exp(2\pi\mathbbm{i}/d)$, $k,l\in\\{0,1,\cdots,d-1\\}$. Importantly,
$\\{A_{i}^{(k)}\\}$ and $\\{A_{j}^{(l)}\\}$ are collections of unitary
operators with eigenvalues $\omega^{i}$ $(i=0,\cdots,d-1)$ defined as the
Fourier transforms of the corresponding projective measurements,

$A_{i}^{(k)}=\sum_{a_{i}=0}^{d-1}\omega^{a_{i}k}\Pi_{i}^{a_{i}},\hskip
14.22636ptA_{j}^{(l)}=\sum_{a_{j}=0}^{d-1}\omega^{a_{j}l}\Pi_{j}^{a_{j}},$ (4)

where $\\{\Pi_{i}^{a_{i}}\\}$ and $\\{\Pi_{j}^{a_{j}}\\}$ are projectors. It
is not difficult to see that $A_{i}^{(k)}$ and $A_{j}^{(l)}$ are simply the
$k$-th power of $A_{i}$ and the $l$-th power of $A_{j}$ respectively. Thus, in
what follows we simply write $A^{k}_{i}$ and $A_{j}^{l}$. Moreover, one can
check that $(A_{i}^{k})^{\dagger}=A_{i}^{d-k}$ and
$(A_{j}^{l})^{\dagger}=A_{j}^{d-l}$ for any $k$, $l$.

###  III.1 Inequality

Next, we propose the following temporal inequality,

$\displaystyle\tau_{d}=\sum_{k=1}^{d-1}$ $\displaystyle\Big{[}a_{k}\langle
A_{1}^{k}\,A_{3}^{d-k}\rangle+a_{k}^{*}\omega^{k}\langle
A_{1}^{k}\,A_{4}^{d-k}\rangle+a_{k}^{*}\langle A_{2}^{k}\,A_{3}^{d-k}\rangle$
$\displaystyle+a_{k}\langle A_{2}^{k}\,A_{4}^{d-k}\rangle+a_{k}\langle
A_{3}^{d-k}\,A_{1}^{k}\rangle+a_{k}^{*}\omega^{k}\langle
A_{4}^{d-k}\,A_{1}^{k}\rangle$ $\displaystyle+a_{k}^{*}\langle
A_{3}^{d-k}\,A_{2}^{k}\rangle+a_{k}\langle
A_{4}^{d-k}\,A_{2}^{k}\rangle\Big{]}\leq C_{d},$ (5)

where
$a_{k}=\dfrac{1-\mathbbm{i}}{2}\exp\Bigg{(}\dfrac{\pi\mathbbm{i}k}{2d}\Bigg{)}$
and

$\displaystyle C_{d}=3\cot\left(\pi/4d\right)-\cot\left(3\pi/4d\right)-4$ (6)

is the classical upper bound of the temporal expression $\tau_{d}$. This
classical bound is derived in the Appendix B. A point to be stressed here is
that (5) represents different temporal inequalities for different $d$.

It should be mentioned that although the structure of the inequality (5) is
somewhat similar to the structure of the SATWAP Bell inequality involving
measurements with arbitrary number of outcomes SATWAP , these two inequalities
are conceptually different. The SATWAP inequality consists of correlation
functions between measurement outcomes of two spatially separated systems
SATWAP . On the other hand, the inequality (5) proposed here contains
correlation functions pertaining to a single system on which different
measurements are performed sequentially. Moreover, the structure of the SATWAP
inequality and that of the above temporal inequality (5) are not exactly the
same. Note further, that although the above inequality (5) is expressed in the
Fourier transformed space, it can also be expressed as a linear function of
$p(a_{i},a_{j}|A_{i},A_{j})$ with real coefficients and always takes real
values as shown in the Appendix B.

Up to now, the details of the temporal inequality (5) are discussed for an
arbitrary preparation $\rho^{(\mathcal{P})}$. The following discussions will
be applicable when Assumption 1 is considered, i.e., when
$\rho^{(\mathcal{P})}=\mathbbm{1}/D$.

Suppose, the condition (2) is satisfied by each of the four unitary (Fourier
transformed) observables $A_{1}$, $A_{2}$, $A_{3}$ and $A_{4}$. Here,
$A_{i}=A_{i}^{1}=A_{i}^{(1)}$ for all $i\in\\{1,2,3,4\\}$ with $A_{i}^{(1)}$
being defined in Eq.(4). Then, it follows from Lemma 1 that the measurements
of $A_{1}$, $A_{2}$, $A_{3}$ and $A_{4}$ can be taken to be projective. Since,
by Assumption 1, $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, we can write the
following,

$\displaystyle p(a_{i},a_{j}|A_{i},A_{j})=\text{Tr}\Big{[}$
$\displaystyle\Pi_{j}^{a_{j}}\,\Pi_{i}^{a_{i}}\,\rho^{(\mathcal{P})}\Big{]}\,\,\,\forall\,i,j\in\\{1,2,3,4\\},$
$\displaystyle\text{and}\,\,\,\forall\,a_{i},a_{j}\in\\{0,1,\cdots,d-1\\}.$
(7)

Then, using Eqs.(3), (4) and (7), we can write for all $k,l=1,\cdots,d-1$ and
for all $i,j\in\\{1,2,3,4\\}$,

$\displaystyle\langle A_{i}^{k}\,A_{j}^{l}\rangle=\langle
A_{i}^{(k)}\,A_{j}^{(l)}\rangle=\text{Tr}\Big{[}A_{i}^{k}\,A_{j}^{l}\,\rho^{(\mathcal{P})}\Big{]}.$

Hence, for the state $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, the left hand side
of the temporal inequality (5) can be expressed as

$\displaystyle\tau_{d}\left(\rho^{(\mathcal{P})}=\mathbbm{1}/D\right)=\text{Tr}\big{[}\rho^{(\mathcal{P})}\,\hat{\beta}_{\tau_{d}}\big{]},$
(8)

where the operator $\hat{\beta}_{\tau_{d}}$ is given by,

$\displaystyle\hat{\beta}_{\tau_{d}}=\sum_{k=1}^{d-1}\Big{[}$ $\displaystyle
a_{k}A_{1}^{k}\,A_{3}^{d-k}+a_{k}^{*}\omega^{k}A_{1}^{k}\,A_{4}^{d-k}+a_{k}^{*}A_{2}^{k}\,A_{3}^{d-k}$
$\displaystyle+a_{k}A_{2}^{k}\,A_{4}^{d-k}+a_{k}A_{3}^{d-k}\,A_{1}^{k}+a_{k}^{*}\omega^{k}A_{4}^{d-k}\,A_{1}^{k}$
$\displaystyle+a_{k}^{*}A_{3}^{d-k}\,A_{2}^{k}+a_{k}A_{4}^{d-k}\,A_{2}^{k}\Big{]}.$
(9)

###  III.2 Sum-of-squares decomposition with maximally mixed state

In order to obtain the sum-of-squares decomposition of the temporal inequality
(5) for $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, let us first define

$\displaystyle B_{1}^{(k)}=a_{k}A_{3}^{-k}+a_{k}^{*}\omega^{k}A_{4}^{-k},$
$\displaystyle B_{2}^{(k)}=a_{k}^{*}A_{3}^{-k}+a_{k}A_{4}^{-k}.$ (10)

Note here that $a_{d-k}=a_{k}^{*}$, and therefore
$B_{x}^{(d-k)}=\Big{[}B_{x}^{(k)}\Big{]}^{\dagger}$ for any $k=1,\cdots,d-1$
and $x=1,2$.

Since, $(A_{i}^{k})^{\dagger}=A_{i}^{d-k}$ and $A_{i}^{k}$ is unitary for all
$i\in\\{1,2,3,4\\}$ and for all $k\in\\{1,\cdots,d-1\\}$, we have
$A_{i}^{-k}=A_{i}^{d-k}$ for all $i\in\\{1,2,3,4\\}$ and for all
$k\in\\{1,\cdots,d-1\\}$. Hence, it follows that

$\displaystyle\hat{\beta}_{\tau_{d}}=\sum_{k=1}^{d-1}\Big{[}A_{1}^{k}\,B_{1}^{(k)}+A_{2}^{k}\,B_{2}^{(k)}+B_{1}^{(k)}\,A_{1}^{k}+B_{2}^{(k)}\,A_{2}^{k}\Big{]}.$

Let us also define,

$P_{x}^{(k)}=\mathbbm{1}-A_{x}^{k}\,B_{x}^{(k)}\hskip 8.5359pt\forall
x\in\\{1,2\\},\,\,\forall k\in\\{1,\cdots,d-1\\}.$ (11)

Now, we have

$\displaystyle\sum_{k=1}^{d-1}\sum_{x=1}^{2}\Big{[}\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}P_{x}^{(k)}\Big{)}\Big{]}$
$\displaystyle=\sum_{k=1}^{d-1}\Big{[}2\,\mathbbm{1}-B_{1}^{(d-k)}A_{1}^{d-k}-A_{1}^{k}B_{1}^{(k)}+\Big{(}B_{1}^{(k)}\Big{)}^{\dagger}\Big{(}B_{1}^{(k)}\Big{)}$
$\displaystyle\hskip 14.22636pt-
B_{2}^{(d-k)}A_{2}^{d-k}-A_{2}^{k}B_{2}^{(k)}+\Big{(}B_{2}^{(k)}\Big{)}^{\dagger}\Big{(}B_{2}^{(k)}\Big{)}\Big{]}.$
(12)

One can verify that

$\sum_{k=1}^{d-1}B_{x}^{(d-k)}A_{x}^{d-k}=\sum_{k=1}^{d-1}B_{x}^{(k)}A_{x}^{k}\hskip
14.22636pt\forall x=1,2.$ (13)

Now, incorporating the fact that
$\Big{(}A_{3}^{d-k}\Big{)}^{\dagger}\Big{(}A_{3}^{d-k}\Big{)}=\Big{(}A_{4}^{d-k}\Big{)}^{\dagger}\Big{(}A_{4}^{d-k}\Big{)}=\mathbbm{1}$
and
$(a_{k})^{2}(\omega^{k})^{*}+(a_{k}^{*})^{2}=(a_{k}^{*})^{2}\omega^{k}+(a_{k})^{2}=0$
for all $k\in\\{1,\cdots,d-1\\}$ one can evaluate that

$\displaystyle\Big{(}B_{1}^{(k)}\Big{)}^{\dagger}\Big{(}B_{1}^{(k)}\Big{)}+\Big{(}B_{2}^{(k)}\Big{)}^{\dagger}\Big{(}B_{2}^{(k)}\Big{)}=2\,\mathbbm{1}\hskip
5.69046pt\forall k.$ (14)

Using Eqs.(12) (13), (14), we have

$\displaystyle\sum_{k=1}^{d-1}\sum_{x=1}^{2}\Big{[}\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}P_{x}^{(k)}\Big{)}\Big{]}=4(d-1)\,\mathbbm{1}-\hat{\beta}_{\tau_{d}}.$
(15)

The left hand side of Eq.(15) is the sum-of-squares decomposition and it is
the sum of positive operators. Hence, we have

$\text{Tr}\Big{[}\rho^{(\mathcal{P})}\big{(}4(d-1)\,\mathbbm{1}-\hat{\beta}_{\tau_{d}}\big{)}\Big{]}\geq
0.$

The above inequality implies that

$\text{Tr}\big{[}\rho^{(\mathcal{P})}\,\hat{\beta}_{\tau_{d}}\big{]}\leq
4(d-1).$ (16)

Hence, the maximum quantum magnitude of $\tau_{d}$ for the state
$\rho^{(\mathcal{P})}=\mathbbm{1}/D$ is $4(d-1)$ when the condition (2) is
satisfied by each of the four unitary observables. It can be checked that
$4(d-1)>C_{d}$ for all $d\geq 2$ SATWAP , where $C_{d}$ is the classical upper
bound of the temporal expression $\tau_{d}$, given by equation (6).

###  III.3 Binary outcome ($d=2$) case

In the case of $d=2$, the temporal inequality (5) reduces to

$\displaystyle\tau_{2}$ $\displaystyle=$
$\displaystyle\frac{1}{\sqrt{2}}\Big{[}\langle A_{1}A_{3}\rangle-\langle
A_{1}A_{4}\rangle+\langle A_{2}A_{3}\rangle+\langle A_{2}A_{4}\rangle$
$\displaystyle+\langle A_{3}A_{1}\rangle-\langle A_{4}A_{1}\rangle+\langle
A_{3}A_{2}\rangle+\langle A_{4}A_{2}\rangle\Big{]}\leq 2\sqrt{2},$

where the measurement of $A_{i}$ (with $i\in\\{1,2,3,4\\}$) has two possible
outcomes denotes by $a_{i}\in\\{0,1\\}$. This turns out to be the symmetrized
version of the temporal inequality proposed in entintime . Interestingly, in
the particular binary outcome scenario, the expression (8) for the quantum
value of (LABEL:tid2) holds for any general input state of arbitrary
dimension, that is, for any $\rho^{(\mathcal{P})}\in\mathbb{C}^{D}$,

$\displaystyle\tau_{2}\left(\rho^{(\mathcal{P})}\right)=\text{Tr}\big{[}\rho^{(\mathcal{P})}\,\hat{\beta}_{\tau_{2}}\big{]}\,\,\,\forall\,\,\rho^{(\mathcal{P})}\in\mathbb{C}^{D},$
(18)

where the operator $\hat{\beta}_{\tau_{2}}$ is given by,

$\displaystyle\hat{\beta}_{\tau_{2}}$ $\displaystyle=$ $\displaystyle
A_{1}\,A_{3}-A_{1}\,A_{4}+A_{2}\,A_{3}+A_{2}\,A_{4}$ (19)
$\displaystyle+A_{3}\,A_{1}-A_{4}\,A_{1}+A_{3}\,A_{2}+A_{4}\,A_{2}.$

To see this, let us consider that the condition (2) is satisfied by the each
of the four observables $A_{1}$, $A_{2}$, $A_{3}$, $A_{4}$. Then, following
Lemma 1, the measurements of $A_{1}$, $A_{2}$, $A_{3}$, $A_{4}$ can be taken
as projective,

$\displaystyle A_{i}=\Pi_{i}^{0}-\Pi_{i}^{1}\hskip 8.5359pt\forall
i\in\\{1,2,3,4\\},$

where $\\{\Pi_{i}^{0},\Pi_{i}^{1}\\}$ are projectors acting on
$\mathbb{C}^{D}$ with

$\displaystyle\Pi_{i}^{a_{i}}=\frac{\mathbbm{1}+(-1)^{a_{i}}A_{i}}{2}\,\,\forall\,a_{i}\in\\{0,1\\}.$
(20)

The joint probability is given by,

$\displaystyle
p(a_{i},a_{j}|A_{i},A_{j})=\text{Tr}\Big{[}\Pi_{j}^{a_{j}}\Pi_{i}^{a_{i}}\rho\Pi_{i}^{a_{i}}\Big{]}$
(21)

$\forall i,j\in\\{1,2,3,4\\}$ and $\forall a_{i},a_{j}\in\\{0,1\\}$. Using the
expression of correlation function

$\displaystyle\langle
A_{i}\,A_{j}\rangle=\sum_{a_{i},a_{j}=0}^{1}(-1)^{a_{i}+a_{j}}p(a_{i},a_{j}|A_{i},A_{j}),$
(22)

and Eqs. (20)-(21), we get the following

$\displaystyle\langle A_{i}\,A_{j}\rangle+\langle
A_{j}\,A_{j}\rangle=\text{Tr}\Big{[}\left(A_{i}A_{j}+A_{j}A_{i}\right)\rho\Big{]}.$
(23)

By considering pairs of terms in the temporal expression (LABEL:tid2), one can
readily verify that the associated quantum operator is given by (19).
Subsequently, the sum-of-squares decomposition (15) for $d=2$ and the optimal
quantum value $4$ of (LABEL:tid2) hold true for any general preparation
$\rho^{(\mathcal{P})}$.

##  IV Certification of quantum measurements

In this section, we would like to state our main results for certifying the
$d$-outcome measurements employing the temporal inequality proposed by us in
the previous section along with its sum-of-squares decomposition. Before
proceeding further, let us first verify that the measurements cannot be
certified uniquely using the temporal inequality (5) if we do not make any
assumption on the state preparation. Here, uniqueness encompasses the unitary
freedom of the measurements.

######  Lemma 2.

There exist at least two sets of preparations and binary-outcome projective
measurements that achieve the maximal violation of the temporal inequality
(LABEL:tid2), but the measurements in these two sets are not unitarily
connected. In other words, uniqueness of the measurements cannot be shown
employing binary outcome temporal inequality (LABEL:tid2) without any
assumption on the preparation.

###### Proof.

Let us first note that the optimal quantum value $4$ of (LABEL:tid2) holds for
arbitrary preparation $\rho^{(\mathcal{P})}\in\mathbb{C}^{D}$ when the
condition (2) is satisfied by each of the four measurements as shown in
Section III.3. Satisfying the condition (2) by each of the four measurements
implies that these measurements are projective. Now, we show that there exist
two different sets of preparations and projective measurements such that the
measurements in these two sets are not connected unitarily although the
maximal quantum violation of the inequality (LABEL:tid2) is achieved by both
of these two sets. Hence, for arbitrary preparations, the measurements cannot
be certified uniquely using the inequality (LABEL:tid2) without any assumption
on the preparation device. The explicit examples of such two different sets of
preparations and projective measurements are given in the Appendix C.
$\sqcap$$\sqcup$

The above lemma implies that at least some assumption on the preparation
device is necessary in order to certify the measurements uniquely using the
quantum violation of the temporal inequality (5). Therefore, we have
considered assumption 1 which states that the preparation device produces a
maximally mixed state of arbitrary dimension.

Before proceeding, let us define the $d$-dimensional generalization of the
$\sigma_{z}$-Pauli matrix in the standard basis given by,

$\displaystyle Z_{d}=\sum_{i=0}^{d-1}\omega^{i}|i\rangle\langle i|.$ (24)

let us also introduce the following $d$-dimensional unitary observable,

$\displaystyle T_{d}=\sum_{i=0}^{d-1}\omega^{i+\frac{1}{2}}|i\rangle\langle
i|-\frac{2}{d}\sum_{i,j=0}^{d-1}(-1)^{\delta_{i,0}+\delta_{j,0}}\omega^{\frac{i+j+1}{2}}|i\rangle\langle
j|,$ (25)

where $\delta_{i,j}$ is the Kronecker delta function. It can be checked that
$Z_{d}$ and $T_{d}$ are unitary with eigenvalues $\omega^{i}$
($i=0,\cdots,d-1$) saha .

With these, we present the following theorem providing the certification of
the quantum measurements. The proof of this theorem is inspired by the self-
testing proof from SATWAP Bell inequality proposed in saha .

######  Theorem 1.

Suppose that the condition (2) is satisfied by each of the four unitary
(Fourier transformed) observables $A_{1},A_{2},A_{3},A_{4},$ and the magnitude
of quantum violation of the temporal inequality (5) is $4(d-1)$. Then, for any
$d$, we have $\mathbb{C}^{D}=\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}$ with
some auxiliary Hilbert space $\mathcal{H}^{\prime}$ of unknown but finite
dimension. Further, there exists a unitary transformation
$U:\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}\rightarrow\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}$,
such that

$\displaystyle UA_{1}U^{\dagger}$
$\displaystyle=Z_{d}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ $\displaystyle
UA_{2}U^{\dagger}$
$\displaystyle=T_{d}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ $\displaystyle
UA_{3}U^{\dagger}$
$\displaystyle=\Big{(}a_{1}^{*}Z_{d}+2(a_{1}^{*})^{3}T_{d}\Big{)}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$
$\displaystyle UA_{4}U^{\dagger}$
$\displaystyle=\Big{(}a_{1}Z_{d}-a_{1}^{*}T_{d}\Big{)}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$

where $a_{1}=\dfrac{1-\mathbbm{i}}{2}\omega^{\frac{1}{4}}$, $Z_{d}$ and
$T_{d}$ are defined earlier and $\mathbbm{1}_{\mathcal{H}^{\prime}}$ is the
identity matrix acting on $\mathcal{H}^{\prime}$.

###### Proof.

Under Assumptions 1 and 2, we can take the measurements of the unitary
observables $A_{i}$ for all $i\in\\{1,2,3,4\\}$ to be projective as each of
these unitary observables satisfies the condition (2). This follows from Lemma
1.

Next, since the magnitude of quantum violation of the temporal inequality (5)
is $4(d-1)$ with $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, using Eq.(15), we can
write

$\displaystyle\text{Tr}\Bigg{[}\rho^{(\mathcal{P})}\,\Bigg{\\{}\sum_{k=1}^{d-1}\sum_{x=1}^{2}\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}P_{x}^{(k)}\Big{)}\Bigg{\\}}\Bigg{]}=0.$

Since $\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}P_{x}^{(k)}\Big{)}\geq 0$
for all $k\in\\{1,\cdots,d-1\\}$ and for all $x\in\\{1,2\\}$, the above
equation implies that

$\displaystyle\text{Tr}\Bigg{[}\rho^{(\mathcal{P})}\,\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}P_{x}^{(k)}\Big{)}\Bigg{]}=0$
$\displaystyle\,\,\,\,\forall\,k\in\\{1,\cdots,d-1\\}$
$\displaystyle\text{and}\,\,\,\forall\,x\in\\{1,2\\}.$ (26)

As mentioned earlier,
$\rho^{(\mathcal{P})}=\sum_{u=0}^{D-1}\frac{1}{D}|\Psi_{u}\rangle\langle\Psi_{u}|$
with $\\{|\Psi_{u}\rangle\\}$ being an arbitrary orthonormal basis in
$\mathbb{C}^{D}$. Hence, from Eq.(26), we have

$\displaystyle\Big{(}P_{x}^{(k)}\Big{)}$
$\displaystyle|\Psi_{u}\rangle=0,\hskip
14.22636pt\langle\Psi_{u}|\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}=0$
$\displaystyle\forall\,x\in\\{1,2\\},\,\,\forall\,k\in\\{1,\cdots,d-1\\},$
$\displaystyle\forall\,u\in\\{0,\cdots,D-1\\}.$

We can therefore, write

$\displaystyle\Big{(}P_{x}^{(k)}\Big{)}\rho^{(\mathcal{P})}=0,$
$\displaystyle\hskip
14.22636pt\rho^{(\mathcal{P})}\Big{(}P_{x}^{(k)}\Big{)}^{\dagger}=0$
$\displaystyle\forall\,x\in\\{1,2\\},\,\,\forall\,k\in\\{1,\cdots,d-1\\}.$
(27)

Taking $\rho^{(\mathcal{P})}=\mathbbm{1}/D$ and using Eqs.(11) and (27), we
get

$\displaystyle A_{x}^{k}\,B_{x}^{(k)}$ $\displaystyle=\mathbbm{1},\hskip
14.22636pt\Big{(}B_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}A_{x}^{k}\Big{)}^{\dagger}=\mathbbm{1}$
$\displaystyle\forall\,x\in\\{1,2\\},\,\,\forall\,k\in\\{1,\cdots,d-1\\}.$
(28)

Using the above two equations along with the condition
$\Big{(}A_{x}^{k}\Big{)}^{\dagger}\,\Big{(}A_{x}^{k}\Big{)}=\mathbbm{1}$, one
has

$\displaystyle\Big{(}B_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}B_{x}^{(k)}\Big{)}=\Big{(}B_{x}^{(d-k)}\Big{)}\,\Big{(}B_{x}^{(k)}\Big{)}=\mathbbm{1}$
$\displaystyle\hskip
25.6073pt\forall\,x\in\\{1,2\\},\,\,\forall\,k\in\\{1,\cdots,d-1\\}.$ (29)

Now, taking $x=1$, the above condition leads to,

$\displaystyle A_{3}^{k}\,A_{4}^{-k}=\omega^{-k}A_{4}^{k}\,A_{3}^{-k}\hskip
25.6073pt\forall\,k\in\\{1,\cdots,d-1\\}.$ (30)

Due to the fact that $A_{i}^{d}=\mathbbm{1}$ for all $i\in\\{1,2,3,4\\}$, the
above relation (30) can be extended to any integer $k\in\mathbb{Z}$.

Next, Eq.(28) also implies that
$B_{x}^{(k)}=(A_{x}^{k})^{\dagger}=(A_{x}^{\dagger})^{k}$ for all
$x\in\\{1,2\\}$ and $k\in\\{1,\cdots,d-1\\}$. Moreover, with $k=1$, Eq.(28)
implies that $B_{x}^{(1)}=A_{x}^{\dagger}$ for all $x\in\\{1,2\\}$. Hence, we
get

$\displaystyle B_{x}^{(k)}$ $\displaystyle=(A_{x}^{\dagger})^{k}$
$\displaystyle=(B_{x}^{(1)})^{k}\hskip
8.5359pt\forall\,x\in\\{1,2\\},\,\,\forall\,k\in\\{1,\cdots,d-1\\}.$ (31)

Eqs.(28), (29), (30) and (31) are sufficient to characterize $A_{1}$, $A_{2}$
$A_{3}$ and $A_{4}$. In fact, it can be shown that if the unitary observables
$A_{3}$ and $A_{4}$ satisfy the conditions (29), (30) and (31), then we can
draw the following two conclusions (the calculations are the same as presented
in the Appendix A of saha ):

  * •

The dimension $D$ is a multiple of the number of outcomes $d$, meaning that

$\displaystyle\mathbb{C}^{D}=\mathbb{C}^{d}\otimes\mathcal{H}^{\prime},$

where $\mathcal{H}^{\prime}$ is some auxiliary Hilbert space of finite
dimension $D/d$ which is unknown as $D$ is arbitrary.

  * •

There exists a unitary transformation
$\widetilde{U}:\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}\rightarrow\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}$,
such that

$\displaystyle\widetilde{U}A_{3}\widetilde{U}^{\dagger}$
$\displaystyle=Z_{d}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ (32)
$\displaystyle\widetilde{U}A_{4}\widetilde{U}^{\dagger}$
$\displaystyle=T_{d}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ (33)

where $Z_{d}$ and $T_{d}$ are defined earlier.

Now, it can be proved that there exists a unitary transformation
$W=:\mathbb{C}^{d}\rightarrow\mathbb{C}^{d}$, such that

$\displaystyle WZ_{d}W^{\dagger}$
$\displaystyle=\Big{(}a_{1}^{*}Z_{d}+2(a_{1}^{*})^{3}T_{d}\Big{)},$ (34)
$\displaystyle WT_{d}W^{\dagger}$
$\displaystyle=\Big{(}a_{1}Z_{d}-a_{1}^{*}T_{d}\Big{)},$ (35)

where $a_{1}=\dfrac{1-\mathbbm{i}}{2}\omega^{\frac{1}{4}}$. The existence of
such a unitary $W$ is proved in the Appendix B of saha .

Therefore, using Eqs.(32)-(35), we can conclude that there exists a unitary
transformation
$U=(W\otimes\mathbbm{1}_{\mathcal{H}^{\prime}})\,\widetilde{U}:\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}\rightarrow\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}$,
such that

$\displaystyle UA_{3}U^{\dagger}$
$\displaystyle=\Big{(}a_{1}^{*}Z_{d}+2(a_{1}^{*})^{3}T_{d}\Big{)}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$
(36) $\displaystyle UA_{4}U^{\dagger}$
$\displaystyle=\Big{(}a_{1}Z_{d}-a_{1}^{*}T_{d}\Big{)}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}.$
(37)

Now, Eqs. (31), (36) and (37) imply that

$\displaystyle UB^{(k)}_{1}U^{\dagger}$
$\displaystyle=\big{(}Z^{\dagger}_{d}\big{)}^{k}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$
(38) $\displaystyle UB^{(k)}_{2}U^{\dagger}$
$\displaystyle=\big{(}T^{\dagger}_{d}\big{)}^{k}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}.$
(39)

In particular, if $A_{3}$ and $A_{4}$ are transformed by applying the unitary
$U$, then $B^{(1)}_{1}=Z^{\dagger}_{d}$ and $B^{(1)}_{2}=T^{\dagger}_{d}$.

Next, Eq.(28) implies that $A_{x}^{k}\,B_{x}^{(k)}=\mathbbm{1}$ for all
$x\in\\{1,2\\}$ and $k\in\\{1,\cdots,d-1\\}$. Hence, with $k=1$, we get

$\displaystyle A_{x}=\big{(}B_{x}^{(1)}\big{)}^{\dagger}\hskip
25.6073pt\forall\,x\in\\{1,2\\}.$ (40)

Hence, Eqs.(38)-(40) imply that there exists a unitary transformation
$U:\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}\rightarrow\mathbb{C}^{d}\otimes\mathcal{H}^{\prime}$,
such that

$\displaystyle UA_{1}U^{\dagger}$
$\displaystyle=Z_{d}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ (41)
$\displaystyle UA_{2}U^{\dagger}$
$\displaystyle=T_{d}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}.$ (42)

Thus, Eqs.(36)-(37) together with Eqs.(41)-(42) complete the proof.
$\sqcap$$\sqcup$

The above Theorem also implies that $4(d-1)$ is the tight upper bound of the
temporal inequality (5) for maximally mixed states. Let us also remark that
the certifiied operators $(a_{1}^{*}Z_{d}+2(a_{1}^{*})^{3}T_{d})$ and
$(a_{1}Z_{d}-a_{1}^{*}T_{d})$ are unitary matrices having $d$ distinct
eigenvalues $\omega^{i}$ with $i\in\\{0,\cdots,d-1\\}$.

###  IV.1 Robustness analysis

So far, we have proposed a certification protocol for the $d$-outcome ideal
measurement settings given in Theorem 1 employing the maximal violation of the
temporal inequality (5). However, in a real experimental scenario there is
always some unavoidable noise and hence, the ideal measurements are hardly
realizable. Thus, the maximal quantum violation of the inequality with
$\rho^{(\mathcal{P})}=\mathbbm{1}/D$ may not be obtained. In such cases, we
ask the question whether we can certify those measurements up to a certain
threshold even when the actual violation differs from the maximal one. The
term robustness of the measurements quantifies the departure of the actual
measurements from the ideal one.

As mentioned earlier, Assumption 1 implies that initially the state is
prepared to be $\rho^{(\mathcal{P})}=\mathbbm{1}/D$. Now, suppose that in an
experimental situation, instead of performing measurements of the ideal
unitary observables $A_{i}$ with $i\in\\{1,2,3,4\\}$ mentioned in the
statements of Theorem 1 for which the magnitude of the temporal inequality (5)
is $4(d-1)$, measurements of the following non-ideal unitary observables are
being performed- $\widetilde{A}_{1}$, $\widetilde{A}_{2}$,
$\widetilde{A}_{3}$, $\widetilde{A}_{4}$. Also consider that each of these
four unitary observables satisfy the condition (2). Next, consider that the
magnitude of the temporal inequality (5) with these non-ideal unitary
observables is $4(d-1)-\epsilon$, where $\epsilon$ is a small positive number.
Note that the maximum quantum violation of the temporal inequality (5) with
$\rho^{(\mathcal{P})}=\mathbbm{1}/D$ is $4(d-1)$ when each of the four unitary
observables satisfy the condition (2), thereby implying that $\epsilon$ cannot
be negative.

Against the above backdrop, we present the following theorem (for proof, see
Appendix D).

######  Theorem 2.

If the quantum value of the temporal expression $\tau_{d}$ given in (5)
realized by unknown unitary (Fourier transformed) observables
$\widetilde{A}_{1}$, $\widetilde{A}_{2}$, $\widetilde{A}_{3}$,
$\widetilde{A}_{4}$ satisfying the condition (2) is $[4(d-1)-\epsilon]$ with
$\epsilon$ being a small positive number, then the following relations hold
true

$\displaystyle(i)\ $
$\displaystyle\Bigg{|}\Bigg{|}\left[A_{1}\big{(}a_{1}A_{3}^{\dagger}+a_{1}^{*}\omega
A_{4}^{\dagger}\big{)}\right]\rho^{(\mathcal{P})}$ $\displaystyle\hskip
19.91684pt-\left[\widetilde{A}_{1}\big{(}a_{1}\widetilde{A}_{3}^{\dagger}+a_{1}^{*}\omega\widetilde{A}_{4}^{\dagger}\big{)}\right]\rho^{(\mathcal{P})}\Bigg{|}\Bigg{|}_{\text{HS}}<\sqrt{\epsilon}.$
(43) $\displaystyle(ii)\ $
$\displaystyle\Bigg{|}\Bigg{|}\left[A_{2}\big{(}a^{*}_{1}A_{3}^{\dagger}+a_{1}A_{4}^{\dagger}\big{)}\right]\rho^{(\mathcal{P})}$
$\displaystyle\hskip
19.91684pt-\left[\widetilde{A}_{2}\big{(}a^{*}_{1}\widetilde{A}_{3}^{\dagger}+a_{1}\widetilde{A}_{4}^{\dagger}\big{)}\right]\rho^{(\mathcal{P})}\Bigg{|}\Bigg{|}_{\text{HS}}<\sqrt{\epsilon}.$
(44) $\displaystyle(iii)\ $
$\displaystyle\Bigg{|}\Bigg{|}\left(A_{4}A_{3}^{\dagger}-\omega
A_{3}A_{4}^{\dagger}\right)\rho^{(\mathcal{P})}$ $\displaystyle\hskip
14.22636pt-\left(\widetilde{A}_{4}\widetilde{A}_{3}^{\dagger}-\omega\widetilde{A}_{3}\widetilde{A}_{4}^{\dagger}\right)\rho^{(\mathcal{P})}\Bigg{|}\Bigg{|}_{\text{HS}}\leq
2\sqrt{\epsilon}\big{(}2+\sqrt{\epsilon}\big{)}.$ (45) $\displaystyle(iv)\ $
$\displaystyle\Bigg{|}\Bigg{|}\left(\omega
A_{2}A_{1}^{\dagger}-A_{1}A_{2}^{\dagger}\right)\rho^{(\mathcal{P})}$
$\displaystyle\hskip
14.22636pt-\left(\omega\widetilde{A}_{2}\widetilde{A}_{1}^{\dagger}-\widetilde{A}_{1}\widetilde{A}_{2}^{\dagger}\right)\rho^{(\mathcal{P})}\Bigg{|}\Bigg{|}_{\text{HS}}\leq
2\sqrt{\epsilon}\big{(}2+\sqrt{\epsilon}\big{)}.$ (46)

where $A_{1},A_{2},A_{3},A_{3}$ are any set of unitary (Fourier transformed)
observables that satisfies the condition (2), achieves $\tau_{d}=4(d-1)$ and
thus satisfies Theorem 1; and $||\cdot||_{\text{HS}}$ denotes the
Hilbert–Schmidt norm.

The above robustness argument is applicable when the magnitude of the temporal
inequality (5) is affected by the non-ideal unitary observables, whereas
satisfying the condition (2) remains unaffected by these non-ideal unitary
observables. However, a more general robustness analysis should also
incorporate the case where the condition (2) is not satisfied by the non-ideal
unitary observables. We leave this question for future study.

##  V Secure randomness certification

Here, we present a protocol for the secure certification of randomness as a
relevant application of our proposed formalism for the certification of
$d$-outcome quantum measurements. In particular, let us consider that the
assumptions 1 and 2 are satisfied. Further, we also assume that the condition
(2) is satisfied by the each of the four unitary observables $A_{1}$, $A_{2}$,
$A_{3}$, $A_{4}$ and the magnitude of the temporal inequality (5) is $4(d-1)$
using the above four measurements.

Consider a scenario, where a party, say, Eve prepares the initial state. In
other words, the internal functioning of the preparation device $\mathcal{P}$
is controlled by Eve. In each experimental run, Eve prepares a pure state
$|\psi^{(\mathcal{P})}_{x}\rangle$ in such a way that, on average, the initial
state becomes $\rho^{(\mathcal{P})}=\mathbbm{1}/D$. Let us assume that Eve
knows beforehand which two measurements will be performed sequentially in each
run. In such a scenario, Eve can always predict the outcome of the first
measurement. For example, consider an experimental run in which measurement of
$A_{i}$ is performed at first on the preparation, and then the measurement of
$A_{j}$ is performed (where $i,j\in\\{1,2,3,4\\}$). In this case, Eve can
predict the outcome of the first measurement by preparing an eigenstate of
$A_{i}$. Hence, no randomness can be certified securely from the first
measurement and therefore, we will focus on randomness certification using the
outcome statistics of the second measurement.

Since, we are not interested in the randomness certification using the outcome
statistics of the first measurement, it excludes certifying classical
randomness associated with the preparation
$\rho^{(\mathcal{P})}=\mathbbm{1}/D$. In other words, although the preparation
device prepares a maximally mixed state, the randomness from the maximally
mixed state is not genuine quantum randomness, but rather, this randomness is
a manifestation of the classical convex mixture of different pure states.
However, after the first measurement, the state collapses to a different pure
state, and thus the outcome of the second measurement provides genuine quantum
randomness. This is why we will certify randomness from
$p(a_{j}|A_{i},A_{j},a_{i})=p(a_{i},a_{j}|A_{i},A_{j})/p(a_{i}|A_{i})$.

Let us now define the measure of randomness, $\mathcal{H}(A_{i},A_{j})$ for a
fixed set of two unitary observables $\\{A_{i},A_{j}\\}$ as,

$\displaystyle\mathcal{H}(A_{i},A_{j})$
$\displaystyle=\min_{\mathcal{S}}\left[-\sum_{a_{i}=0}^{d-1}p(a_{i}|A_{i})\sum_{a_{j}=0}^{d-1}\alpha\log_{2}\alpha\right],$
$\displaystyle\text{with}\,\,\alpha=p(a_{j}|A_{i},A_{j},a_{i})$ (47)

and $\mathcal{S}$ denoting all possible strategies of Eve for preparing
$A_{i}$ reproducing the observed probabilities. The above quantification is
based on the Shannon entropy. Further, we have taken average of it over all
possible outcomes of the first measurement. Note that the Shannon entropy
characterizes the average randomness involved in the probability distributions
shannon . On the other hand, the concept of min-Entropy, that is widely used
to quantify the randomness associated with a probability distribution,
characterises the minimum unpredictability/randomness involved in the
probability distribution minen . In our certification scheme, the condition
(2) needs to be satisfied for each outcome of each of the four measurements
involved. Further, the certification protocol relies on the temporal
inequality (5) which involves correlation functions. Hence, all outcomes of
all of the four measurements are equally important in our certification
protocol. Therefore, the natural choice to quantify the randomness that can be
certified in our certification protocol is the quantification based on Shannon
entropy.

Moreover, to quantify the genuine or guaranteed randomness we have to consider
the minimum in (47) over all possible Eve’s strategy of preparing the four
unitary observables $A_{i}$ that satisfy the condition (2) and gives
$\tau_{d}=4(d-1)$ under Assumptions 1-2.

Since, the condition (2) is satisfied by the each of the four unknown unitary
observables $A_{1}$, $A_{2}$, $A_{3}$, $A_{4}$ and the magnitude of the
temporal inequality (5) is $4(d-1)$, Theorem 1 implies that there exists $U$
such that

$\displaystyle U\Pi_{1}^{a_{1}}U^{\dagger}$
$\displaystyle=\widetilde{\Pi}_{1}^{a_{1}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}=|Z^{a_{1}}_{d}\rangle\langle
Z^{a_{1}}_{d}|\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ $\displaystyle
U\Pi_{2}^{a_{2}}U^{\dagger}$
$\displaystyle=\widetilde{\Pi}_{2}^{a_{2}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}=|T^{a_{2}}_{d}\rangle\langle
T^{a_{2}}_{d}|\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ $\displaystyle
U\Pi_{3}^{a_{3}}U^{\dagger}$
$\displaystyle=\widetilde{\Pi}_{3}^{a_{3}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}=|M^{a_{3}}_{d}\rangle\langle
M^{a_{3}}_{d}|\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ $\displaystyle
U\Pi_{4}^{a_{4}}U^{\dagger}$
$\displaystyle=\widetilde{\Pi}_{4}^{a_{4}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}=|N^{a_{4}}_{d}\rangle\langle
N^{a_{4}}_{d}|\otimes\mathbbm{1}_{\mathcal{H}^{\prime}},$ $\displaystyle\hskip
28.45274pt\forall\,\,a_{1},a_{2},a_{3},a_{4}\in\\{0,1,\cdots,d-1\\},$ (48)

where $\\{\Pi_{i}^{a_{i}}\\}$ are the set of projectors for measurement of
$A_{i}$; $|Z^{a_{1}}_{d}\rangle$ is the eigenstate of $Z_{d}$ with eigenvalue
$\omega^{a_{1}}$, $|T^{a_{2}}_{d}\rangle$ is the eigenstate of $T_{d}$ with
eigenvalue $\omega^{a_{2}}$, $|M^{a_{3}}_{d}\rangle$ is the eigenstate of
$M_{d}=a_{1}^{*}Z_{d}+2(a_{1}^{*})^{3}T_{d}$ with eigenvalue $\omega^{a_{3}}$,
$|N^{a_{4}}_{d}\rangle$ is the eigenstate of $N_{d}=a_{1}Z_{d}-a_{1}^{*}T_{d}$
with eigenvalue $\omega^{a_{4}}$. Note that satisfying the condition (2) by
the each of the four unitary observables $A_{1}$, $A_{2}$, $A_{3}$, $A_{4}$
implies that the measurements of these four unitary observables are
projective. Moreover, if the magnitude of the temporal inequality (5) is
achieved to be $4(d-1)$ using above four unitary observables, then Theorem 1
implies that these four measurements are rank-one projective measurements.
This follows from the fact that each of these four measurements has $d$ number
of possible outcomes and the dimension of each of the operators $Z_{d}$,
$T_{d}$, $M_{d}$, $N_{d}$ is $d$. Thus, we have taken each of the projectors
in the above Eq.(48) to be rank-one.

Next, we evaluate the expression of $p(a_{j}|A_{i},A_{j},a_{i})$ in order to
find out $\mathcal{H}(A_{i},A_{j})$ for a given $\\{A_{i},A_{j}\\}$. From
Eq.(48), we can write the following,

$\displaystyle p(a_{j}|A_{i},A_{j},a_{i})$
$\displaystyle=\frac{\text{Tr}\Bigg{[}\Big{(}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{)}\Big{(}U\rho^{(\mathcal{P})}U^{\dagger}\Big{)}\Big{(}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{)}\Big{(}\widetilde{\Pi}_{j}^{a_{j}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{)}\Bigg{]}}{\text{Tr}\Bigg{[}\Big{(}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{)}\Big{(}U\rho^{(\mathcal{P})}U^{\dagger}\Big{)}\Bigg{]}}.$

Since $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, the above expression can be
simplified as
$p(a_{j}|A_{i},A_{j},a_{i})=\frac{\text{Tr}\Big{[}\widetilde{\Pi}_{i}^{a_{i}}\widetilde{\Pi}_{j}^{a_{j}}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{]}}{\text{Tr}\Big{[}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{]}}=\text{Tr}\Big{[}\widetilde{\Pi}_{i}^{a_{i}}\widetilde{\Pi}_{j}^{a_{j}}\Big{]}=\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}$, where $|A_{i}^{a_{i}}\rangle$
($|A_{j}^{a_{j}}\rangle$) is the eigenstate of $A_{i}$ ($A_{j}$) with
eigenvalue $\omega^{a_{i}}$ ($\omega^{a_{j}}$). In the above, we have used the
fact that $\widetilde{\Pi}_{i}^{a_{i}}$ is a rank-one projector, implying that
$\text{Tr}\Big{[}\widetilde{\Pi}_{i}^{a_{i}}\Big{]}=1$.

On the other hand, we have for $\rho^{(\mathcal{P})}=\mathbbm{1}/D$

$\displaystyle p(a_{i}|A_{i})$
$\displaystyle=\text{Tr}\Bigg{[}\Big{(}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{)}\Big{(}U\rho^{(\mathcal{P})}U^{\dagger}\Big{)}\Bigg{]}$
$\displaystyle=\frac{1}{D}\text{Tr}\Bigg{[}\Big{(}\widetilde{\Pi}_{i}^{a_{i}}\otimes\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{)}\Bigg{]}$
$\displaystyle=\frac{1}{d},$

where we have used $\text{Tr}\Big{[}\widetilde{\Pi}_{i}^{a_{i}}\Big{]}=1$ and
$\text{Tr}\Big{[}\mathbbm{1}_{\mathcal{H}^{\prime}}\Big{]}=D/d$. Therefore,
Eq.(47) becomes

$\displaystyle\mathcal{H}(A_{i},A_{j})=\min_{\mathcal{S}}\left[-\sum_{a_{j}=0}^{d-1}\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}\log_{2}\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}\right].$ (49)

As mentioned earlier, $\mathcal{S}$ denotes all possible strategies of Eve for
preparing $A_{i}$ reproducing the observed probabilities. All these strategies
are connected unitarily as can be seen from Eq.(48). However, the expression
$\sum_{a_{j}=0}^{d-1}\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}\log_{2}\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}$ is independent of the unitary
$U$. Hence, from Eq.(49), we have for the present case

$\displaystyle\mathcal{H}(A_{i},A_{j})=-\sum_{a_{j}=0}^{d-1}\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}\log_{2}\Big{|}\langle
A_{i}^{a_{i}}|A_{j}^{a_{j}}\rangle\Big{|}^{2}.$ (50)

Here it should be mentioned that if $i=j$, i.e., if $A_{i}=A_{j}$, then from
the above Eq.(50), we have $\mathcal{H}(A_{i},A_{j})=0$. Hence, no randomness
can be certified.

Next, consider that $i\neq j$. At first, let us take $i=1$ and $j=2$. In other
words, we are considering the case when the measurement of $A_{1}$ is
performed at first on the initial preparation and then the measurement of
$A_{2}$ is performed. For this case, Eq. (50) reduces to

$\displaystyle\mathcal{H}(A_{1},A_{2})=-\sum_{a_{2}=0}^{d-1}\Big{|}\langle
Z_{d}^{a_{1}}|T_{d}^{a_{2}}\rangle\Big{|}^{2}\log_{2}\Big{|}\langle
Z_{d}^{a_{1}}|T_{d}^{a_{2}}\rangle\Big{|}^{2}.$ (51)

This can be evaluated using the expressions of the eigenstates of $Z_{d}$ and
$T_{d}$. The spectral decomposition of $Z_{d}$ and $T_{d}$ are given by saha ,

$\displaystyle Z_{d}=\sum_{q=0}^{d-1}\omega^{q}|q\rangle\langle
q|,~{}~{}\text{and}~{}~{}T_{d}=\sum_{r=0}^{d-1}\omega^{r}|r\rangle\langle
r|_{T_{d}}$

with

$\displaystyle|r\rangle_{T_{d}}=\frac{2}{d}\sum_{q=0}^{d-1}(-1)^{\delta_{q,0}}\frac{\omega^{-\frac{q}{2}}}{1-\omega^{r-q-\frac{1}{2}}}|q\rangle$

Using these, we have

$\displaystyle\Big{|}\langle
Z_{d}^{a_{1}}|T_{d}^{a_{2}}\rangle\Big{|}^{2}=\frac{4}{d^{2}}\frac{1}{\left\lvert
1-\omega^{a_{1}-a_{2}-\frac{1}{2}}\right\rvert^{2}}.$ (52)

Now, replacing the variable $(a_{1}-a_{2})$ by $x$ and using the fact that
$\omega^{d}=1$, we get

$\displaystyle\mathcal{H}(A_{1},A_{2})$
$\displaystyle=-\sum_{x=0}^{d-1}\frac{4}{d^{2}}\frac{1}{\left\lvert
1-\omega^{x-\frac{1}{2}}\right\rvert^{2}}\log_{2}\frac{4}{d^{2}}\frac{1}{\left\lvert
1-\omega^{x-\frac{1}{2}}\right\rvert^{2}}.$ (53)

Next, let us take $i=2$ and $j=1$. In other words, we are considering the case
when the measurement of $A_{2}$ is performed at first on the initial
preparation and then the measurement of $A_{1}$ is performed. In this case,
one can easily check that

$\displaystyle\mathcal{H}(A_{2},A_{1})$
$\displaystyle=\mathcal{H}(A_{1},A_{2})$

We now calculate $\mathcal{H}(A_{1},A_{2})$ for several values of $d$ and the
variation is plotted in Fig. 2. From this figure, it is evident that
$\mathcal{H}(A_{1},A_{2})$ increases with $d$.

Figure 2: The blue dotted lines demonstrate the variation of the amount of
output randomness $\mathcal{H}(A_{i},A_{j})$ produced in the present
certification protocol with the number of outcomes $d$. Here,
$\mathcal{H}(A_{i},A_{j})$ is the amount of randomness produced from the
second measurement when the measurement of $A_{i}$ is performed at first on
the initial preparation and then the measurement of $A_{j}$ is performed. This
plot is for four possible cases- (1) when $i=1$ and $j=2$, (2) when $i=2$ and
$j=1$, (3) when $i=3$ and $j=4$, (4) when $i=4$ and $j=3$.

Since $M_{d}=a_{1}^{*}Z_{d}+2(a_{1}^{*})^{3}T_{d}$ and
$N_{d}=a_{1}Z_{d}-a_{1}^{*}T_{d}$ are connected to $Z_{d}$ and $T_{d}$,
respectively, with the same unitary $W$ (see proof of Theorem 1), we have
$\Big{|}\langle A_{1}^{u}|A_{2}^{v}\rangle\Big{|}^{2}=\Big{|}\langle
A_{3}^{u}|A_{4}^{v}\rangle\Big{|}^{2}$ for all $u,v\in\\{0,1,\cdots,d-1\\}.$.
Hence, for the case with $i=3$, $j=4$ and for the case with $i=4$, $j=3$, we
have

$\displaystyle\mathcal{H}(A_{3},A_{4})=\mathcal{H}(A_{4},A_{3})=\mathcal{H}(A_{1},A_{2}).$
(54)

For other combinations of $i\neq j\in\\{1,2,3,4\\}$, we have not evaluated
$\mathcal{H}(A_{i},A_{j})$ in the present study, and we leave it as an open
question.

##  VI Conclusions

Formulating more efficient certification protocols for quantum measurements
requiring lesser assumption or trust on the preparation device is a worthwhile
enterprise that will be helpful for establishing secure quantum information
theoretic and cryptographic applications. In this work we have proposed a
novel framework for certification of $d$-outcome quantum measurements, which
does not require entanglement or any other spatial correlation. Further, our
protocol does not need any prior knowledge or assumption about the dimension
of the system on which the measurements are performed. Considering a scenario
consisting of a preparation followed by two measurements in sequence, we have
first proposed a class of inequalities involving temporal correlations, and
have then established their sum-of-squares decomposition. Using quantum
violations of these inequalities, we have certified the $d$-outcome
measurements uniquely up to some unitary freedom. Moreover, we have shown that
our certification protocol is robust against non-ideal realization. As a
proposed application, our protocol can be used to generate genuine quantum
randomness.

It needs to be emphasized that one cannot certify the measurements uniquely
without any assumption whatsoever on the preparation device, employing the
quantum violation of our proposed temporal inequalities. Our protocol works
with the preparation device producing maximally mixed states of arbitrary
dimension $D$. Such states can be prepared reliably in the laboratory, and
remain unaffected by environmental effects. Our scheme certifies $d$-outcome
measurements of dimension $D$, where $D\geq d$, for which the preparation
device has to produce a maximally mixed state of dimension $D$. Therefore, in
our certification scheme, preparing $D$ number of mutually orthogonal pure
states in $\mathbb{C}^{D}$ in different experimental runs randomly by the
preparation device is sufficient. In comparison, tomography of such
measurements requires $\mathcal{O}(D^{2})$ characterized quantum preparations
Gianani20 . Hence, the requirement on the preparation device in our protocol
is less demanding than that in the case of tomography of quantum measurements.
Additionally, tomography also requires prior knowledge about measurement
devices, in contrast to those in our scheme that behave essentially as black
boxes without memory.

Before concluding, it would be pertinent to mention that the analysis
presented in this article for certifying quantum components received from an
unknown provider, also furnishes a general methodology for introducing new
temporal inequalities following the structure of the corresponding Bell
inequalities. Adopting this methodology, certification schemes for quantum
devices using temporal correlations without requiring entanglement can be
designed based on the existing certification protocols in the Bell scenarios
involving entanglement. Our analysis can be further extended for the
certification of mutually unbiased $d$-outcome measurements using temporal
correlations that may be useful for secure certification of larger amounts of
randomness. Finally, it is worth noting that $d$-outcome measurements can be
rigorously implemented in optical setups opticalsetup . Unlike certification
protocols of $d$-outcome measurements proposed earlier saha , our scheme does
not require any entanglement, thereby being less demanding to be verified
experimentally, and should be more desirable for commercial purposes.

### Acknowledgements

DD and DS acknowledge Science and Engineering Research Board (SERB),
Government of India for financial support through the National Post Doctoral
Fellowship (File Nos.: PDF/2020/001358 and PDF/2020/001682). ASM acknowledges
support from the project no. DST/ICPS/QuEST/2018/79 of the Department of
Science and Technology, Government of India.

## References

  * (1) I. L. Chuang and M. A. Nielsen, _Prescription for experimental determination of the dynamics of a quantum black box_ , J. Mod. Opt. 44, 2455 (1997).
  * (2) J. F. Poyatos, J. I. Cirac, and P. Zoller, _Complete Characterization of a Quantum Process: The Two-Bit Quantum Gate_ , Phys. Rev. Lett. 78, 390 (1997).
  * (3) Z. Hradil, _Quantum-state estimation_ , Phys. Rev. A, 55, 1561 (1997).
  * (4) J. Helsen, J. J. Wallman, S. T. Flammia, and S. Wehner, _Multiqubit randomized benchmarking using few samples_ , Phys. Rev. A, 100, 032304 (2019).
  * (5) E. Magesan, J. M. Gambetta, and J. Emerson, _Scalable and Robust Randomized Benchmarking of Quantum Processes_ , Phys. Rev. Lett., 106, 180504 (2011).
  * (6) E. Knill, D. Leibfried, R. Reichle, J. Britton, R. B. Blakestad, J. D. Jost, C. Langer, R. Ozeri, S. Seidelin, and D. J. Wineland, _Randomized benchmarking of quantum gates_ , Phys. Rev. A, 77, 012307 (2008).
  * (7) J. Eisert, D. Hangleiter, N. Walk, I. Roth, D. Markham, R. Parekh, U. Chabaud, and E. Kashefi, __,Nature Reviews Physics 2, 382 (2020).
  * (8) D. Mayers and A. Yao, _Proceedings of the 39th_ FOCS (IEEE Computer Society, Washington, DC, 1998), p. 503.
  * (9) D. Mayers and A. Yao, Quantum Inf. Comput. 4, 273 (2004).
  * (10) I. Supic, J. Bowles, Quantum 4, 337 (2020).
  * (11) A. Aćin, N. Brunner, N. Gisin, S. Massar, S. Pironio, and V. Scarani, _Device-Independent Security of Quantum Cryptography against Collective Attacks_ , Phys. Rev. Lett., 98, 230501 (2007).
  * (12) S. Pironio, A. Aćin, S. Massar, A. B. Giroday, D. N. Matsukevich, P. Maunz, S. Olmschenk, D. Hayes, L. Luo, T. A. Manning and C. Monroe, _Random numbers certified by Bell’s theorem_ , Nature, 464, 1021 (2010).
  * (13) B. W. Reichardt, F. Unger, and U. Vazirani, Nature 496, 456 (2013).
  * (14) M. McKague, T. H. Yang, and V. Scarani, _Robust self-testing of the singlet_ , Journal of Physics A: Mathematical and Theoretical 45, 455304 (2012).
  * (15) T. H. Yang and M. Navascues, _Robust self-testing of unknown quantum systems into any entangled two-qubit states_ , Phys. Rev. A 87, 050102 (2013).
  * (16) C. Bamps and S. Pironio, _Sum-of-squares decompositions for a family of Clauser-Horne-Shimony-Holt-like inequalities and their application to self-testing_ , Phys. Rev. A 91, 052111 (2015).
  * (17) A. Coladangelo, K. T. Goh, and V. Scarani, _All pure bipartite entangled states can be self-tested_ , Nature Communications 8, 15485 (2017).
  * (18) Y. Wang, X. Wu, and V. Scarani, _All the self-testings of the singlet for two binary measurements_ , New Journal of Physics 18, 025021 (2016).
  * (19) I. Supic, A. Coladangelo, R. Augusiak, and A. Acin, _Self-testing protocols based on the chained Bell inequalities_ , New Journal of Physics 20, 083041 (2018).
  * (20) I. Supic and M. J. Hoban, _Self-testing through EPR-steering_ , New Journal of Physics 18, 075006 (2016).
  * (21) S. Goswami, B. Bhattacharya, D. Das, S. Sasmal, C. Jebaratnam, and A. S. Majumdar, _One-sided device-independent self-testing of any pure two-qubit entangled state_ , Phys. Rev. A 98, 022311 (2018).
  * (22) Z. Bian, A. S. Majumdar, C. Jebaratnam, K. Wang, L. Xiao, X. Zhan, Y. Zhang, P. Xue, _Experimental demonstration of one-sided device-independent self-testing for any pure two-qubit entangled state_ , Phys. Rev. A 101, 020301 (R) (2020).
  * (23) H. Shrotriya, K. Bharti, and L.-C. Kwek, _Robust semi-device-independent certification of all pure bipartite maximally entangled states via quantum steering_ , Phys. Rev. Research 3, 033093 (2021).
  * (24) S. Sarkar, D. Saha, and R. Augusiak, _Certification of incompatible measurements using quantum steering_ , arXiv:2107.02937 (2021).
  * (25) A. Tavakoli, J. Kaniewski, T. Vertesi, D. Rosset, and N. Brunner, _Self-testing quantum states and measurements in the prepare-and-measure scenario_ , Phys. Rev. A 98, 062307 (2018).
  * (26) K. Bharti, M. Ray, A. Varvitsiotis, N. A. Warsi, A. Cabello, and L. C. Kwek, _Robust Self-Testing of Quantum Systems via Noncontextuality Inequalities_ , Phys. Rev. Lett. 122, 250403 (2019).
  * (27) D. Saha, R. Santos, and R. Augusiak, _Sum-of-squares decompositions for a family of noncontextuality inequalities and self-testing of quantum devices_ , Quantum 4, 302 (2020).
  * (28) J. D. Bancal, N. Sangouard, and P. Sekatski, _Noise-Resistant Device-Independent Certification of Bell State Measurements_ , Phys. Rev. Lett. 121, 250506 (2018).
  * (29) M. O. Renou, J. Kaniewski, and N. Brunner, _Self-Testing Entangled Measurements in Quantum Networks_ , Phys. Rev. Lett. 121, 250507 (2018).
  * (30) J. Kaniewski, _Self-testing of binary observables based on commutation_ , Phys. Rev. A 95, 062323 (2017).
  * (31) M. McKague and M. Mosca, in Theory of Quantum Computation, Communication, and Cryptography, edited by W. van Dam, V. M. Kendon, and S. Severini (Springer Berlin Heidelberg, Berlin, Heidelberg, 2011) pp. 113–130.
  * (32) J. Bowles, I. Supic, D. Cavalcanti, and A. Acin, _Self-testing of Pauli observables for device-independent entanglement certification_ , Phys. Rev. A, 98 042336 (2018).
  * (33) A. G. Maity, S. Mal, C. Jebarathinam, and A. S. Majumdar, _Self-testing of binary Pauli measurements requiring neither entanglement nor any dimensional restriction_ , Phys. Rev. A, 103, 062604 (2021).
  * (34) A. Salavrakos, R. Augusiak, J. Tura, P. Wittek, A. Acín, and S. Pironio, _Bell Inequalities Tailored to Maximally Entangled States_ , Phys. Rev. Lett. 119, 040402 (2017).
  * (35) S. Sarkar, D. Saha, J. Kaniewski, and R. Augusiak, _Self-testing quantum systems of arbitrary local dimension with minimal number of measurements_ (accepted in npj Quantum Information), arXiv:1909.12722 [quant-ph].
  * (36) C. Brukner, S. Taylor, S. Cheung, and V. Vedral, _Quantum Entanglement in Time_ ,  arXiv: quant-ph/0402127.
  * (37) C. E. Shannon, _Communication theory of secrecy systems_ , The Bell System Technical Journal, 28 , 4 (1949).
  * (38) R. Konig, R. Renner, and C. Schaffner, _The Operational Meaning of Min- and Max-Entropy_ , IEEE Transactions on Information Theory, 55, 9, 4337-4347 (2009).
  * (39) I. Gianani, Y. S. Teo, V. Cimini, H. Jeong, G. Leuchs, M. Barbieri, and L. L. Sánchez-Soto, PRX Quantum 1, 020307 (2020).
  * (40) M. Zukowski, A. Zeilinger, Anton and M. A. Horne, Phys. Rev. A 55, 2564 (1997).
  * (41) A. J. Leggett, and A. Garg, _Quantum mechanics versus macroscopic realism: Is the flux there when nobody looks?_ Phys. Rev. Lett. 54, 857 (1985).

##  Appendix A Proof of Lemma 1

In general, the measurement of $A_{i}$ can be taken as a POVM with
$A_{i}\equiv\\{M_{i}^{0},M_{i}^{1},\cdots,M_{i}^{d-1}\\}$, where
$M_{i}^{a_{i}}$ are called POVM elements. The general condition for POVM
implies that $M_{i}^{a_{i}}\geq 0$ for all $a_{i}\in\\{0,1,\cdots,d-1\\}$;
$\sum\limits_{a_{i}=0}^{d-1}M_{i}^{a_{i}}=\mathbbm{1}$.

The Kraus operators of the POVM $A_{i}$ are given by,
$\\{U_{i}^{0}\sqrt{M_{i}^{0}},U_{i}^{1}\sqrt{M_{i}^{1}},\cdots,U_{i}^{d-1}\sqrt{M_{i}^{d-1}}\\}$,
where $U_{i}^{a_{i}}$ are unitary operators for all $i\in\\{1,2,3,4\\}$ and
for all $a_{i}\in\\{0,1,\cdots,d-1\\}$. Now, consider that the following
condition holds for $\rho^{(\mathcal{P})}=\mathbbm{1}/D$,

$p(a_{i},a_{i}|A_{i},A_{i})=p(a_{i}|A_{i}).$ (55)

Also, since condition (1) holds for all $|\psi\rangle\in\mathbb{C}^{D}$ (where
$D$ is arbitrary), we have

$\displaystyle p(a_{i},a_{i}|A_{i},A_{i})\leq p(a_{i}|A_{i})\hskip
8.5359pt\forall|\psi\rangle\in\mathbb{C}^{D}.$ (56)

Hence, the condition (55) for $\rho^{(\mathcal{P})}=\mathbbm{1}/D$ together
with (56) implies that

$p(a_{i},a_{i}|A_{i},A_{i})=p(a_{i}|A_{i})\hskip
8.5359pt\forall|\psi\rangle\in\mathbb{C}^{D}.$ (57)

From the above, it follows that

$\displaystyle\langle\psi|\sqrt{M_{i}^{a_{i}}}^{\dagger}U_{i}^{a_{i}^{\dagger}}M_{i}^{a_{i}}U_{i}^{a_{i}}\sqrt{M_{i}^{a_{i}}}|\psi\rangle=\langle\psi|M_{i}^{a_{i}}|\psi\rangle\hskip
4.26773pt\forall|\psi\rangle\in\mathbb{C}^{D}.$ (58)

Therefore, Eq.(57) implies that

$\displaystyle\sqrt{M_{i}^{a_{i}}}^{\dagger}U_{i}^{a_{i}^{\dagger}}M_{i}^{a_{i}}U_{i}^{a_{i}}\sqrt{M_{i}^{a_{i}}}=M_{i}^{a_{i}}.$
(59)

Let
$M_{i}^{a_{i}}=\sum\limits_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}$
with $0<\lambda^{(a_{i})}_{x}\leq 1$;
$\Big{\\{}\Big{|}\Psi^{(a_{i})}_{0}\Big{\rangle},\Big{|}\Psi^{(a_{i})}_{1}\Big{\rangle},\cdots,\Big{|}\Psi^{(a_{i})}_{D-1}\Big{\rangle}\Big{\\}}$
being an orthonormal basis in $\mathbb{C}^{D}$ and $1\leq m\leq D$. Putting
this in Eq.(59), we get the following,

$\displaystyle\Bigg{(}\sum_{x=0}^{m-1}\sqrt{\lambda^{(a_{i})}_{x}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}U_{i}^{a_{i}^{\dagger}}\Bigg{(}\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}U_{i}^{a_{i}}\Bigg{(}\sum_{x=0}^{m-1}\sqrt{\lambda^{(a_{i})}_{x}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}=\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}.$
(60)

Let
$U_{i}^{a_{i}^{\dagger}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}=\Big{|}\Phi^{(a_{i})}_{x}\Big{\rangle}$,
where
$\Big{\\{}\Big{|}\Phi^{(a_{i})}_{0}\Big{\rangle},\Big{|}\Phi^{(a_{i})}_{1}\Big{\rangle},\cdots,\Big{|}\Phi^{(a_{i})}_{D-1}\Big{\rangle}\Big{\\}}$
is another orthonormal basis in $\mathbb{C}^{D}$. Using this, we get from
Eq.(60),

$\displaystyle\Bigg{(}\sum_{x=0}^{m-1}\sqrt{\lambda^{(a_{i})}_{x}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}\Bigg{(}\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Phi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Bigg{)}\Bigg{(}\sum_{x=0}^{m-1}\sqrt{\lambda^{(a_{i})}_{x}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}=\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}.$
(61)

Let $\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}$ belongs to the orthonormal basis
$\Big{\\{}\Big{|}\Psi^{(a_{i})}_{0}\Big{\rangle},\Big{|}\Psi^{(a_{i})}_{1}\Big{\rangle},\cdots,\Big{|}\Psi^{(a_{i})}_{D-1}\Big{\rangle}\Big{\\}}$
and $k\in\\{0,1,\cdots,m-1\\}$. With this, we get the following from Eq.(61),

$\displaystyle\Big{\langle}\Psi^{(a_{i})}_{k}\Big{|}\Bigg{[}\Bigg{(}\sum_{x=0}^{m-1}\sqrt{\lambda^{(a_{i})}_{x}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}\Bigg{(}\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Phi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Bigg{)}\Bigg{(}\sum_{x=0}^{m-1}\sqrt{\lambda^{(a_{i})}_{x}}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Bigg{)}\Bigg{]}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}$
$\displaystyle=\Big{\langle}\Psi^{(a_{i})}_{k}\Big{|}\Big{(}\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}\Big{)}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}.$
(62)

After simplifying, we get the following condition from Eq.(62),

$\displaystyle\sum_{x=0}^{m-1}\lambda^{(a_{i})}_{x}\Bigg{|}\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}\Bigg{|}^{2}=1.$
(63)

Since,
$\Big{\\{}\Big{|}\Phi^{(a_{i})}_{0}\Big{\rangle},\Big{|}\Phi^{(a_{i})}_{1}\Big{\rangle},\cdots,\Big{|}\Phi^{(a_{i})}_{D-1}\Big{\rangle}\Big{\\}}$
is an orthonormal basis in $\mathbb{C}^{D}$, we have

$\displaystyle\sum_{x=0}^{D-1}\Bigg{|}\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}\Bigg{|}^{2}=1.$
(64)

Now, subtracting Eq.(63) from Eq.(64), we get the following,

$\displaystyle\sum_{x=0}^{m-1}(1-\lambda^{(a_{i})}_{x})\Bigg{|}\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}\Bigg{|}^{2}+\sum_{x=m}^{D-1}\Bigg{|}\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}\Bigg{|}^{2}=0.$
(65)

The left hand side of the above equation is the sum of positive terms. This
sum is zero if and only if each term is zero. Hence, we have

$\displaystyle\Big{\langle}\Phi^{(a_{i})}_{x}\Big{|}\Psi^{(a_{i})}_{k}\Big{\rangle}=0\hskip
8.5359pt\forall x\in\\{m,m+1,\cdots,D-1\\}.$

As mentioned earlier, $k\in\\{0,1,\cdots,m-1\\}$. Hence, the above condition
is true if and only if

$\displaystyle\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}=\Big{|}\Phi^{(a_{i})}_{x}\Big{\rangle}\hskip
8.5359pt\forall x\in\\{0,\cdots,D-1\\}.$

That is, $U_{i}^{a_{i}^{\dagger}}=\mathbbm{1}$. Hence, condition (65) reduces
to $\lambda^{(a_{i})}_{k}=1$. Now, one can choose any arbitrary
$k\in\\{0,1,\cdots,m-1\\}$ for which the above holds. In other words, we have
the following,

$\displaystyle\lambda^{(a_{i})}_{k}=1\hskip 8.5359pt\forall
k\in\\{0,1,\cdots,m-1\\}.$ (66)

Hence, we have
$M_{i}^{a_{i}}=\sum\limits_{x=0}^{m-1}\Big{|}\Psi^{(a_{i})}_{x}\Big{\rangle}\Big{\langle}\Psi^{(a_{i})}_{x}\Big{|}$.
That is, $M_{i}^{a_{i}}$ is a projector. Now, if condition (55) holds for all
$a_{i}\in\\{0,1,\cdots,d-1\\}$, then the above argument implies that the
measurement of $A_{i}$ is a projective measurement.

##  Appendix B Analysis of the temporal inequality (5) and its classical bound

Consider the following quantity $\widetilde{\tau}_{d}$ which is a function of
several probability distributions as introduced in SATWAP ,

$\displaystyle\widetilde{\tau}_{d}:=\sum_{k=0}^{\left\lfloor
d/2\right\rfloor-1}\big{[}\alpha_{k}(\mathbb{P}^{1}_{k}+\mathbb{P}^{2}_{k})-\beta_{k}(\mathbb{Q}^{1}_{k}+\mathbb{Q}^{2}_{k})\big{]},$
(67)

where the expressions $\mathbb{P}^{1}_{k}$, $\mathbb{P}^{2}_{k}$,
$\mathbb{Q}^{1}_{k}$ and $\mathbb{Q}^{2}_{k}$ are defined as

$\mathbb{P}^{1}_{k}=p(A_{1}=A_{3}+k)+p(A_{2}=A_{3}-k)+p(A_{2}=A_{4}+k)+p(A_{1}=A_{4}-k-1),$
(68)
$\mathbb{Q}^{1}_{k}=p(A_{1}=A_{3}-k-1)+p(A_{2}=A_{3}+k+1)+p(A_{2}=A_{4}-k-1)+p(A_{1}=A_{4}+k),$
(69)
$\mathbb{P}^{2}_{k}=p(A_{3}=A_{1}+k)+p(A_{3}=A_{2}-k)+p(A_{4}=A_{2}+k)+p(A_{4}=A_{1}-k-1),$
(70)

and

$\mathbb{Q}^{2}_{k}=p(A_{3}=A_{1}-k-1)+p(A_{3}=A_{2}+k+1)+p(A_{4}=A_{2}-k-1)+p(A_{4}=A_{1}+k),$
(71)

with

$\displaystyle\alpha_{k}=\frac{1}{2d}[g(k)+(-1)^{d}\tan\left(\frac{\pi}{4d}\right)],~{}~{}~{}~{}~{}\beta_{k}=\frac{1}{2d}[g(k+1/2)-(-1)^{d}\tan\left(\frac{\pi}{4d}\right)].$
(72)

Here, $g(k)=\cot[\pi(k+1/4)/d]$. Also,
$p(A_{i}=A_{j}+k):=\sum_{m=0}^{d-1}p(a_{i}=m+k\,\,\text{mod}\,\,d,a_{j}=m|A_{i},A_{j})$,
where $p(a_{i}=m+k\,\,\text{mod}\,\,d,a_{j}=m|A_{i},A_{j})$ denotes the joint
probability of getting the outcome $a_{i}=(m+k\,\,\text{mod}\,\,d)$ when the
measurement of $A_{i}$ is performed on the initially prepared state
$\rho^{(\mathcal{P})}$ and the outcome $a_{j}=m$ when the measurement of
$A_{j}$ is performed on the post measurement state of $A_{i}$. Following this
notation, $\mathbb{P}^{1}_{k}$ and $\mathbb{Q}^{1}_{k}$ involve the
probability distributions for the experimental runs in which $A_{1}$ or
$A_{2}$ is measured at first on the initial preparation $\rho^{(\mathcal{P})}$
and then $A_{3}$ or $A_{4}$ is measured on the post measurement state.
Similarly, $\mathbb{P}^{2}_{k}$ and $\mathbb{Q}^{2}_{k}$ contain the
probability distributions for the experimental runs in which $A_{3}$ or
$A_{4}$ is measured at first on the initial preparation $\rho^{(\mathcal{P})}$
and then $A_{1}$ or $A_{2}$ is measured on the post measurement state.

Now, following the calculations mentioned in the supplementary material of the
Ref. SATWAP , it can be shown that

$\tau_{d}=d\,\widetilde{\tau}_{d}-8S$ (73)

with

$S=\frac{1}{2}\Bigg{\\{}1-\cot\left[\frac{\pi}{d}\left(\left\lfloor\frac{d}{2}\right\rfloor+\frac{1}{4}\right)\right]\Bigg{\\}}.$
(74)

Here, $\tau_{d}$ is the left hand side of the temporal inequality (5), i.e.,

$\displaystyle\tau_{d}=\sum_{k=1}^{d-1}$ $\displaystyle\Big{[}a_{k}\langle
A_{1}^{k}\,A_{3}^{d-k}\rangle+a_{k}^{*}\omega^{k}\langle
A_{1}^{k}\,A_{4}^{d-k}\rangle+a_{k}^{*}\langle
A_{2}^{k}\,A_{3}^{d-k}\rangle+a_{k}\langle
A_{2}^{k}\,A_{4}^{d-k}\rangle+a_{k}\langle
A_{3}^{d-k}\,A_{1}^{k}\rangle+a_{k}^{*}\omega^{k}\langle
A_{4}^{d-k}\,A_{1}^{k}\rangle$ $\displaystyle+a_{k}^{*}\langle
A_{3}^{d-k}\,A_{2}^{k}\rangle+a_{k}\langle
A_{4}^{d-k}\,A_{2}^{k}\rangle\Big{]}.$

One can see that $\widetilde{\tau}_{d}$ is actually a linear function of
probability distributions $p(a_{i},a_{j}|A_{i},A_{j})$ with real coefficients.
Hence, Eq.(73) implies that the left hand side of the temporal inequality (5)
always takes real values.

Let us now concentrate on the classical bound of the inequality (5) proposed
in the main text. Note that $\widetilde{\tau}_{d}$ can be expressed in the
following alternative form,

$\displaystyle\widetilde{\tau}_{d}=\sum_{k=0}^{d-1}\alpha_{k}\Big{[}$
$\displaystyle
p(A_{1}=A_{3}+k)+p(A_{2}=A_{4}+k)+p(A_{3}=A_{1}+k)+p(A_{4}=A_{2}+k)$
$\displaystyle+p(A_{2}=A_{3}-k)+p(A_{1}=A_{4}-k-1)+p(A_{3}=A_{2}-k)+p(A_{4}=A_{1}-k-1)\Big{]}.$
(75)

This can be achieved using the relation that $\alpha_{k}=-\beta_{d-k-1}$.
Hence, the terms of the sum which are attached with $\beta_{k}$ can be shifted
to indices $k=\left\lfloor d/2\right\rfloor,\cdots,d-1$ and are now associated
with an $\alpha_{k}$ SATWAP . For the cases where $d$ is odd, the term
$k=\left\lfloor d/2\right\rfloor$ disappears, as $\alpha_{\left\lfloor
d/2\right\rfloor}=0$.

Next, we use the notion of “macrorealism” lgi  which is the conjunction of the
following two assumptions, in order to derive the classical bound of the
temporal inequality (5): (i) Realism: At any instant, irrespective of any
measurement, a system is definitely in any one of the available states such
that all its observable properties have definite values. (ii) Noninvasive
measurability: It is possible, in principle, to determine which of the states
the system is in, without affecting the state itself or the system’s
subsequent evolution. This notion of “macrorealism” is one of the central
concepts underpinning the classical world view.

The conjunction of the assumptions ‘Realism’ and ‘Noninvasive measurability’
implies that the probability of getting the outcomes $a_{i}$ and $a_{j}$, when
the measurements of $A_{i}$ and $A_{j}$, respectively, are performed, does not
depend on the order of the two measurements. Mathematically, it implies that
$p(a_{i},a_{j}|A_{i},A_{j})=p(a_{j},a_{i}|A_{j},A_{i})$. Using this and from
the definition of $p(A_{i}=A_{j}+k)$, we have

$\displaystyle p(A_{j}=A_{i}+k)$ $\displaystyle=p(A_{i}=A_{j}-k)$
$\displaystyle=p(A_{i}=A_{j}+d-k)\,\,\,\,\,\,\forall
i,j\in\\{1,2,3,4\\}\,\,\text{and}\,\,\forall k\in\\{0,1,\cdots,d-1\\}.$

Hence, we have

$\displaystyle\sum_{k=0}^{d-1}\Big{[}p(A_{i}=A_{j}+k)+p(A_{j}=A_{i}+k)\Big{]}=\sum_{k=0}^{d-1}2p(A_{i}=A_{j}+k)\,\,\,\forall
i,j\in\\{1,2,3,4\\}.$ (76)

Using (76) and (75), the expression of $\widetilde{\tau}_{d}$ for classical
systems (denoted by $\widetilde{\tau}_{d_{C}}$) becomes

$\displaystyle\widetilde{\tau}_{d_{C}}=\sum_{k=0}^{d-1}2\alpha_{k}\Big{[}$
$\displaystyle
p(A_{1}=A_{3}+k)+p(A_{2}=A_{4}+k)+p(A_{2}=A_{3}-k)+p(A_{1}=A_{4}-k-1)\Big{]}.$
(77)

Now, ‘Realism’ implies that we can assign definite value to each of the
unitary observables which is revealed as the outcome of the measurement. Let
the assigned value of $A_{i}$ be denoted by $v_{i}$ for all
$i\in\\{1,2,3,4\\}$. Also, ‘Noninvasive measurability’ implies that $v_{i}$
remains unaffected whether or not any measurement is performed prior to the
measurement of $A_{i}$. Next, let us assign one value $q$ such that
$p(A_{i}=A_{j}+k)=\delta_{k,q}$, where $\delta_{k,q}$ is the Kronecker delta
function. Here $q$ depends on $A_{i}$ and $A_{j}$ but not all pairs of $A_{i}$
and $A_{j}$ appearing in $\widetilde{\tau}_{d_{C}}$. In this way, we can
define four variables $q_{i}$ $\in$ $\\{0,1...,d-1\\}$ satisfying the
following conditions SATWAP ,

$\displaystyle v_{1}-v_{3}$ $\displaystyle=q_{1},$ $\displaystyle v_{3}-v_{2}$
$\displaystyle=q_{2},$ $\displaystyle v_{2}-v_{4}$ $\displaystyle=q_{3},$
$\displaystyle v_{4}-v_{1}$ $\displaystyle=q_{4}+1.$ (78)

Due to the chained character of these equations, we have

$q_{4}=-1-\sum_{i=1}^{3}q_{i}~{}\text{mod}~{}d.$

With these, $\widetilde{\tau}_{d_{C}}$ becomes

$\displaystyle\widetilde{\tau}_{d_{C}}=2\left(\sum_{i=1}^{3}\alpha_{q_{i}}+\alpha_{-1-\sum_{i=1}^{3}q_{i}~{}\text{mod}~{}d}\right),$
(79)

where $\alpha_{k}$ is defined in Eq.(72). Therefore, the classical bound of
$\widetilde{\tau}_{d}$ is given by,

$\widetilde{C}_{d}=2\max_{0\leq q_{1},q_{2},q_{3}\leq
d-1}\left(\sum_{i=1}^{3}\alpha_{q_{i}}+\alpha_{-1-\sum_{i=1}^{3}q_{i}~{}\text{mod}~{}d}\right).$
(80)

Next, using Theorem 1 in the supplementary material of the Ref. SATWAP , we
have

$\max_{0\leq q_{1},q_{2},q_{3}\leq
d-1}\left(\sum_{i=1}^{3}\alpha_{q_{i}}+\alpha_{-1-\sum_{i=1}^{3}q_{i}~{}\text{mod}~{}d}\right)=3\alpha_{0}+\alpha_{d-1}$
(81)

Hence, using Eqs.(72), (73) and (74), the classical bound $C_{d}$ of the
temporal inequality (5) is obtained as follows

$\displaystyle C_{d}$ $\displaystyle=d\widetilde{C}_{d}-8S$
$\displaystyle=2d(3\alpha_{0}+\alpha_{d-1})-8S$
$\displaystyle=3\cot\left(\frac{\pi}{4d}\right)-\cot\left(\frac{3\pi}{4d}\right)-4.$
(82)

##  Appendix C Proof of Lemma 2

Here we present an example to show that if we are not restricted to any
assumption on the state preparation, then there exists two different
measurements settings such that those two measurement strategies are not
connected unitarily although the maximal quantum violation of the inequality
(LABEL:tid2) is achieved.

For the first strategy, the prepared state is of the form

$\begin{pmatrix}\cos\theta\\\ e^{\mathbbm{i}\phi}\sin\theta\\\ 0\\\
\end{pmatrix}$

for any $\theta,\phi$, and the measurements are of the form
$A_{i}=A_{i}^{+}-A_{i}^{-}$ such that $A^{+}_{i}=|u_{i}\rangle\langle u_{i}|$
and $A_{i}^{-}=\mathbbm{1}-|u_{i}\rangle\langle u_{i}|$ wherein

$|u_{1}\rangle=\begin{pmatrix}1\\\ 0\\\ 0\\\
\end{pmatrix},~{}~{}|u_{2}\rangle=\begin{pmatrix}\cos{\pi/4}\\\ \sin{\pi/4}\\\
0\\\ \end{pmatrix},~{}~{}|u_{3}\rangle=\begin{pmatrix}\cos{\pi/8}\\\
\sin{\pi/8}\\\ 0\\\
\end{pmatrix},~{}~{}|u_{4}\rangle=\begin{pmatrix}~{}\cos{\pi/8}\\\
-\sin{\pi/8}\\\ 0\\\ \end{pmatrix}.$

For the second strategy, the prepared state is

$\begin{pmatrix}0.427\\\ -0.512-\mathbbm{i}0.548\\\
~{}0.067+\mathbbm{i}0.747\\\ \end{pmatrix}.$

and the measurements are of the form $A_{i}=A_{i}^{+}-A_{i}^{-}$ such that
$A^{+}_{i}=|v_{i}\rangle\langle v_{i}|$ and
$A_{i}^{-}=\mathbbm{1}-|v_{i}\rangle\langle v_{i}|$ wherein

$|v_{1}\rangle=\begin{pmatrix}1\\\ 0\\\ 0\\\
\end{pmatrix},~{}~{}|v_{2}\rangle=\begin{pmatrix}0.582\\\
-0.275+\mathbbm{i}0.308\\\ -0.264+\mathbbm{i}0.317\\\
\end{pmatrix},~{}~{}|v_{3}\rangle=\begin{pmatrix}\cos{\pi/4}\\\
1/2~{}e^{\mathbbm{i}\pi/4}\\\ 1/2~{}e^{\mathbbm{i}\pi/4}\\\
\end{pmatrix},~{}~{}|v_{4}\rangle=\begin{pmatrix}0.910\\\
-0.135-\mathbbm{i}0.384\\\ -0.104-\mathbbm{i}0.393\\\ \end{pmatrix}.$

We can verify that both the strategies achieve the maximum quantum violation,
that is, 4, of the temporal inequality (LABEL:tid2). If there exists a
unitary, say $U$, that transforms one set of measurements to the another, then
the following relations must hold

$U|u_{i}\rangle=|v_{i}\rangle,\quad\forall i=1,2,3,4.$ (83)

However, the fact that $|\langle u_{1}|u_{3}\rangle|\neq|\langle
v_{1}|v_{3}\rangle|$ implies that such unitary does not exist. Note that the
above example is in the three-dimensional binary outcome projective
measurements scenario. Other such examples can easily be constructed in higher
dimensions.

##  Appendix D Proof of Theorem 2

We first take the condition (2) to be satisfied by the each of the four non-
ideal unitary observables $\widetilde{A}_{1}$, $\widetilde{A}_{2}$,
$\widetilde{A}_{3}$, $\widetilde{A}_{4}$ under Assumptions 1-2. Hence, we can
take the four non-ideal measurements to be projective, which follows from
Lemma 1. With this, we have
$\text{Tr}[\hat{\beta}_{\tau_{d}}\rho^{(\mathcal{P})}]=4(d-1)-\epsilon$, where
$\hat{\beta}_{\tau_{d}}$ is the operator given by Eq.(9) with
$\widetilde{A}_{1}$, $\widetilde{A}_{2}$, $\widetilde{A}_{3}$,
$\widetilde{A}_{4}$. Similar to (III.2), we define

$\displaystyle\widetilde{B}_{1}^{(k)}=a_{k}\widetilde{A}_{3}^{-k}+a_{k}^{*}\omega^{k}\widetilde{A}_{4}^{-k},$
$\displaystyle\widetilde{B}_{2}^{(k)}=a_{k}^{*}\widetilde{A}_{3}^{-k}+a_{k}\widetilde{A}_{4}^{-k}.$
(84)

Let us also define the following,

$\widetilde{P}_{x}^{(k)}=\mathbbm{1}-\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\hskip
8.5359pt\forall x\in\\{1,2\\},\,\,\forall k\in\\{1,\cdots,d-1\\}.$ (85)

Now, following the calculation similar to that in Sec. III.2, we get Eq.(15)
involving $\widetilde{P}_{x}^{(k)}$ and the operator $\hat{\beta}_{\tau_{d}}$
with $\widetilde{A}_{1}$, $\widetilde{A}_{2}$, $\widetilde{A}_{3}$,
$\widetilde{A}_{4}$. From this, we have

Tr
$\displaystyle\Big{[}\rho^{(\mathcal{P})}\sum_{k=1}^{d-1}\sum_{x=1}^{2}\Big{[}\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}\Big{]}\Big{]}=\text{Tr}\Big{[}\rho^{(\mathcal{P})}(4(d-1)\,\mathbbm{1}-\hat{\beta}_{\tau_{d}})\Big{]}.$

Since $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, we get,

$\displaystyle\text{Tr}\Big{[}\sum_{k=1}^{d-1}\sum_{x=1}^{2}\Big{[}\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}\Big{]}\Big{]}=D\epsilon.$
(86)

Being the sum of positive numbers, we get for the individual term,

$\displaystyle\text{Tr}\Big{[}\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}\Big{]}=f_{k,x}(\epsilon)\leq
D\epsilon~{}~{}~{}\forall~{}~{}k,x.$ (87)

where $\sum_{k,x}f_{k,x}(\epsilon)=D\epsilon$ and $f_{k,x}(\epsilon)\geq 0$
for all $k,x$. Now, from Eq.(87), we get

$\displaystyle\Big{|}\Big{|}\widetilde{P}_{x}^{(k)}\Big{|}\Big{|}_{\text{HS}}\leq\sqrt{D\epsilon}~{}~{}~{}\forall~{}~{}k,x.$
(88)

Hence, from Eq.(85), we can write that

$\displaystyle\Big{|}\Big{|}\mathbbm{1}-\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Big{|}\Big{|}_{\text{HS}}\leq\sqrt{D\epsilon}~{}~{}~{}\forall~{}~{}k,x.$
(89)

Now, for the ideal measurements, Eq.(28) implies that
$A_{x}^{k}\,B_{x}^{(k)}=\mathbbm{1}$ for all $k,x$. Thus, from the above
relation we get

$\Big{|}\Big{|}A_{x}^{k}\,B_{x}^{(k)}-\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Big{|}\Big{|}_{\text{HS}}\leq\sqrt{D\epsilon}\
\forall k,x.$ (90)

Since $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, we get the following from Eq.(90),

$\displaystyle\Big{|}\Big{|}\left(A_{x}^{k}\,B_{x}^{(k)}\right)\rho^{(\mathcal{P})}-\left(\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\right)\rho^{(\mathcal{P})}\Big{|}\Big{|}_{\text{HS}}$
$\displaystyle\leq\sqrt{\frac{\epsilon}{D}}$
$\displaystyle<\sqrt{\epsilon}\,\,\,\,\forall k,x.$ (91)

Putting $x=k=1$, in Eq.(91), we get Eqs.(43), and putting and putting
$x=2,k=1$ in Eq.(91), we get (44). These constitute a set of robustness
arguments of our certification scheme.

We can derive another set of robustness arguments of our certification scheme
as described below. Note that Eq.(87) also implies the following,

$\displaystyle\Big{|}\Big{|}\Big{(}\widetilde{P}_{x}^{(k)}\Big{)}^{\dagger}\Big{|}\Big{|}_{\text{HS}}$
$\displaystyle=\Big{|}\Big{|}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Big{|}\Big{|}_{\text{HS}}$
$\displaystyle\leq\sqrt{D\epsilon}~{}~{}~{}\forall~{}~{}k,x,$ (92)

Next, we have for all $k,x$

$\displaystyle\Big{|}\Big{|}\mathbbm{1}+\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Big{|}\Big{|}_{\text{HS}}$
$\displaystyle=\Big{|}\Big{|}2\mathbbm{1}-\Big{[}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Big{]}\Big{|}\Big{|}_{\text{HS}}$
$\displaystyle\leq
2\Big{|}\Big{|}\mathbbm{1}\Big{|}\Big{|}_{\text{HS}}+\Big{|}\Big{|}-\Big{[}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Big{]}\,\Big{|}\Big{|}_{\text{HS}}$
(93) $\displaystyle\leq\sqrt{D}\big{(}2+\sqrt{\epsilon}\big{)}$ (94)

where we have used the triangle inequality for the Hilbert-Schmidt norm to get
(93). We have also used (92) and the fact that
$\Big{|}\Big{|}\mathbbm{1}\Big{|}\Big{|}_{\text{HS}}=\sqrt{D}$ to get (94).

In a similar way, it can be shown using (89) that

$\displaystyle\Big{|}\Big{|}\mathbbm{1}+\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Big{|}\Big{|}_{\text{HS}}\leq\sqrt{D}\big{(}2+\sqrt{\epsilon}\big{)}~{}~{}~{}\forall~{}~{}k,x.$
(95)

Now, we can obtain the following relation for all $k,x$,

$\displaystyle\Big{|}\Big{|}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}\Big{|}\Big{|}_{\text{HS}}$
$\displaystyle=\Big{|}\Big{|}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}\,\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}\Big{|}\Big{|}_{\text{HS}}$
(96)
$\displaystyle=\Bigg{|}\Bigg{|}\frac{1}{2}\Bigg{[}\Bigg{(}\mathbbm{1}+\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Bigg{)}\Bigg{(}\mathbbm{1}-\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Bigg{)}+\Bigg{(}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Bigg{)}\Bigg{(}\mathbbm{1}+\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Bigg{)}\Bigg{]}\Bigg{|}\Bigg{|}_{\text{HS}}$
(97)
$\displaystyle\leq\frac{1}{2}\Bigg{|}\Bigg{|}\Bigg{(}\mathbbm{1}+\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Bigg{)}\Bigg{(}\mathbbm{1}-\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Bigg{)}\Bigg{|}\Bigg{|}_{\text{HS}}+\frac{1}{2}\Bigg{|}\Bigg{|}\Bigg{(}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Bigg{)}\Bigg{(}\mathbbm{1}+\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Bigg{)}\Bigg{|}\Bigg{|}_{\text{HS}}$
(98)
$\displaystyle\leq\frac{1}{2}\Bigg{|}\Bigg{|}\mathbbm{1}+\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Bigg{|}\Bigg{|}_{\text{HS}}\,\Bigg{|}\Bigg{|}\mathbbm{1}-\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Bigg{|}\Bigg{|}_{\text{HS}}+\frac{1}{2}\Bigg{|}\Bigg{|}\mathbbm{1}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Bigg{|}\Bigg{|}_{\text{HS}}\,\Bigg{|}\Bigg{|}\mathbbm{1}+\widetilde{A}_{x}^{k}\,\widetilde{B}_{x}^{(k)}\Bigg{|}\Bigg{|}_{\text{HS}}$
(99) $\displaystyle\leq D\sqrt{\epsilon}\big{(}2+\sqrt{\epsilon}\big{)}$ (100)

where we have used
$\Big{(}\widetilde{A}_{x}^{k}\Big{)}^{\dagger}\Big{(}\widetilde{A}_{x}^{k}\Big{)}=\mathbbm{1}$
(since, $\widetilde{A}_{x}^{k}$ is a unitary operator). Next, the triangle
inequality for the Hilbert-Schmidt norm is used to get (98). We obtain (99) as
the Hilbert-Schmidt norm is a submultiplicative norm (i.e., for all $n\times
n$ square matrices $A$ and $B$,
$||AB||_{\text{HS}}\leq||A||_{\text{HS}}\,\,||B||_{\text{HS}}$). Finally, we
have used conditions (89), (92), (94), (95) to get (100) from (99).

Now, for ideal measurements, Eq.(29) implies that
$\Big{(}B_{x}^{(k)}\Big{)}^{\dagger}\Big{(}B_{x}^{(k)}\Big{)}=\mathbbm{1}$ for
all $x\in\\{1,2\\}$ and for all $k\in\\{1,\cdots,d-1\\}$. Hence, from (100),
we get

$\displaystyle\Big{|}\Big{|}\Big{(}B_{x}^{(k)}\Big{)}^{\dagger}\Big{(}B_{x}^{(k)}\Big{)}-\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}\Big{|}\Big{|}_{\text{HS}}\leq
D\sqrt{\epsilon}\big{(}2+\sqrt{\epsilon}\big{)}.$ (101)

Next, considering $\rho^{(\mathcal{P})}=\mathbbm{1}/D$, we get the following
from the above inequality,

$\displaystyle\Bigg{|}\Bigg{|}\left[\Big{(}B_{x}^{(k)}\Big{)}^{\dagger}\Big{(}B_{x}^{(k)}\Big{)}\right]\rho^{(\mathcal{P})}-\left[\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}^{\dagger}\Big{(}\widetilde{B}_{x}^{(k)}\Big{)}\right]\rho^{(\mathcal{P})}\Big{|}\Big{|}_{\text{HS}}\leq\sqrt{\epsilon}\big{(}2+\sqrt{\epsilon}\big{)}.$
(102)

Now, putting $x=1$ and $k=1$, we get (45) after some simplification. Eq.(45)
presents another robustness argument of our certification scheme for $A_{3}$
and $A_{4}$.

A similar procedure can be followed in order to establish robustness arguments
for $A_{1}$ and $A_{2}$. For this, consider

$C_{1}^{(k)}=a_{k}A_{1}^{-k}+a_{k}^{*}A_{2}^{-k}~{}~{}\text{and}~{}~{}C_{2}^{(k)}=\omega_{k}a_{k}^{*}A_{1}^{-k}+a_{k}A_{2}^{-k}.$

Then, one can have another sum-of-squares decomposition of the inequality (5)
as

$\displaystyle\sum_{k=1}^{d-1}\sum_{x=1}^{2}\Big{[}\Big{(}Q_{x}^{(k)}\Big{)}^{\dagger}\,\Big{(}Q_{x}^{(k)}\Big{)}\Big{]}=4(d-1)\,\mathbbm{1}-\hat{\beta}_{\tau_{d}}$
$\displaystyle\hskip 42.67912pt\text{with}\hskip
4.26773ptQ_{x}^{(k)}=\mathbbm{1}-A_{x+2}^{k}\,C_{x}^{(k)}\hskip
11.38092pt\forall x\in\\{1,2\\},\,\forall k\in\\{1,\cdots,d-1\\}.$ (103)

Through a similar analysis as discussed above, we get the following relation
for all $k,x$,

$\displaystyle\Bigg{|}\Bigg{|}\left[\Big{(}C_{x}^{(k)}\Big{)}^{\dagger}\Big{(}C_{x}^{(k)}\Big{)}\right]\rho^{(\mathcal{P})}-\left[\Big{(}\widetilde{C}_{x}^{(k)}\Big{)}^{\dagger}\Big{(}\widetilde{C}_{x}^{(k)}\Big{)}\right]\rho^{(\mathcal{P})}\Big{|}\Big{|}_{\text{HS}}\leq\sqrt{\epsilon}\big{(}2+\sqrt{\epsilon}\big{)}.$
(104)

Now, putting $x=1$ and $k=1$ in (104), we get the robustness expression (46)
involving $A_{1}$ and $A_{2}$.