{'fraction_non_alphanumeric': 0.04000853515416622, 'fraction_numerical': 0.007254881041288809, 'mean_word_length': 4.587779433681073, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Modeling Leggett-Garg-inequality violation

The Leggett-Garg inequality is a widely used test of the"quantumness"of a system, and involves correlations between measurements realized at different times. According to its widespread interpretation, a violation of the Legget-Garg inequality disproofs macroscopic realism and non-invasiveness. Nevertheless, recent results point out that macroscopic realism is a model dependent notion and that one should always be able to attribute to invasiveness a violation of a Legget-Garg inequality. This opens some natural questions: how to provide such an attribution in a systematic way? How can apparent macroscopic realism violation be recast into a dimensional independent invasiveness model? The present work answers these questions by introducing an operational model where the effects of invasiveness are controllable through a parameter associated with what is called the {\it measurability} of the physical system. Such a parameter leads to different generalized measurements that can be associated with the dimensionality of a system, to measurement errors or to back action.


I. INTRODUCTION
Most of the introductory sentences of scientific papers in the domain of quantum mechanics express its contrasts and contradictions with our everyday life-built intuition. One may wonder if what is at the heart of the quantum mechanical incoherences with our world is the elusive definition of what is "classical". It is of course tempting to define as classical everything that does not seem to behave quantum mechanically, as for instance objects in human scale. Nevertheless, even using this intuitive notion poses problem, since it is not more straightforward to define what one means by "behave quantum mechanically" than the opposite. One aspect of quantum mechanics that is incompatible with a classical theory, defined as local and realist by Einstein, Podolsky and Rosen [1,2], is Bell-type inequalities violation [3][4][5]. However, one cannot safely assert that all states that do not violate these inequalities are nonquantum. Perhaps the most general property of quantum mechanics is contextuality [6][7][8], that can be observed for any quantum state [9,10]. Assuming noncontextuality allows one to derive inequalities, of which Bell's are a special case. Such inequalities suffer, in their broader and state independent version, of a lack of intuitive interpretation. They do not classify quantum states according to any usefulness they may have as a resource, or any of their particular properties that help one's understanding of the quantum-classical frontier. In this spirit, Leggett and Garg [11] proposed, in the 1980s, an inequality that is often presented as enabling to witness quantumness in a macroscopic system when violated. This inequality, known as the Leggett-Garg inequality (LGI), involves measurements of observables that can be associated with macroscopic properties of a system at different times, defined here asQ(t i ). By defining C kl ≡ Q (t k )Q(t l ) , the LGI can be written as [12]: In the usual interpretation of the LGI, it must be satisfied if the following two assumptions hold: (i) Macroscopic Realism (MR): a macroscopic system with two or more macroscopically distinct states available to it will at all times be in one of those states.
(ii) Noninvasive measurability (NIM): it is possible, in principle, to determine the state of the system with arbitrarily small perturbation to its subsequent dynamics.
Violation of the LGI would thus imply nonclassicality as defined above [13]. Experimental tests of the LGI and propositions can be found in [14][15][16][17][18][19][20][21][22], where [14] is probably the first experimental violation of the LGI involving measurements realized in a quantum number associated with a macroscopic system. Nevertheless, the notion of "macroscopicity" in the LGI has always been somewhat controversial. Since one of the mathematical requirements in its derivation is that correlations between measurements should be correlations between dichotomic observables, one may wonder what is the sense of macroscopicity. Can one talk of macroscopicity when only two effective quantum numbers are assigned to each observable? In [23], some physical insight was provided to help interpret the role of macroscopicity in LGI: it was shown that classical physics emerges when the resolution of a classical measurement apparatus decreases faster with the dimensionality of a system than the intrinsic quantum noise increases. In this case, the dimensionality of the system is associated with the value of the total spin j. Macroscopicity emerges in the limit of j → ∞, for which measurements become coarse grained and, consequently, noninvasive. Recently, another issue was raised, expressing some discontent of the community with the usual interpretations of a LGI violation [24,25]. It was shown in Ref. [24], that the definition of macroscopic realism appearing in (1) is model dependent, since in order to be tested, it assumes the Copenhagen interpretation of quantum mechanics. In the authors' point of view, which is the one assumed here, macroscopic realism, as usually interpreted in LGI's is analogous to a superselection rule [26] that prepares the system in a statistical mixture of some privileged states. According to this definition, violating LGI would imply that the system is, at some point, in a quantum superposition. However, the notion of quantum superposition is not necessarily incompatible neither with macroscopicity nor with realism [27]. The authors conclude thus that the only assumption that is actually being tested in a LGI in a model independent way is invasiveness.
This approach of the LGI becomes even clearer if one considers its mathematical formulation, which makes explicit what features of correlations between measurement results are being tested. To this end, one should assume that observablesQ(t i ) are measured, at each one of the many runs of an experiment, in order to compute the statistical average needed to obtain the correlations C kl . When the two-time correlations C kl are computed in the situation where the four measurementŝ Q(t i ), (i = 1, 2, 3, 4), were realized, inequality (1) is always satisfied, both in the classical and in the quantum realm. The important point is when one considers the case where only the two measurementsQ(t k ) andQ(t l ) are made at each run to compute C kl . In this case, Eq. (1) is valid only if the noninvasiveness assumption is made. This last situation (two measurements at each run) corresponds to the LGI. Thus, the LGI tests the pertinence of the hypotheses that correlations between two measurement outcomes realized at different times are undisturbed by the realization of other measurements to the system at different times. Given these results, how can one interpret previously obtained ones, where macroscopicity seemed to enhance coarse graining, leading to a quantum to classical transition and the loss of violation of the LGI? Is it possible to model and control invasiveness in a way that does not depend on the system's size?

III. MODELING INVASIVENESS OF MEASUREMENTS IN LGIS
With the purpose of formalizing the previous discussion and determining in a precise mathematical way the interplay between invasiveness, dimensionality and violation of the LGI, we propose, in the present manuscript, a mode to test a LGI using positive operator valued mea-surements (POVM). In our model, invasiveness can be associated with the resolution and efficiency of a measurement apparatus. These parameters, according to the experimental situation, may, or not, be associated with the dimensionality of the system. The introduced POVMs provide a physically sound and operational interpretation of what is actually being tested by the LGI, unifying and clarifying the notions of invasiveness and macroscopicity.
The system considered consists of a spin j, associated, for instance, with an atom or, equivalently, an orbital angular momentum. Therefore,Ĵ α , α = x, y, z, is the α-component ofĴ, the total spin operator.Ĵ z eigenstates are denoted as |m , −j ≤ m ≤ j. We consider that the dynamics of the system is governed by the Hamiltonian: where Ω and ω are constants with the dimension of frequency.
We then define measurements that help clarifying the conditions for violating the LGI (1) by manipulation of a controlled parameter. Such measurements are performed on an initially maximally mixed state to ensure that nonclassicality can only appear from the system's dynamics and the subsequent measurements.
In [23], it was shown that definingQ(0) =Π z , wherê Π z = m (−1) j−m |m m| is the parity operator, leads to violation of a LGI irrespectively of the dimensionality of the system (value of j) and for an initial state as (3). Parity is a projective measurement that involves all the states |m , creating the analogous of "collective states" associated with a single quantum number. Parity reduces systems of any dimension to an effective two level system through a mapping that applies to all possible states. Thus, the time evolution of the parity operator involves all the system's states in the same way (except for a sign change). It is thus intuitively acceptable that such a measurement will always lead to a LGI violation, since one can hardly think of a less invasive dichotomic measurement. Our strategy consists in defining an observable depending on a parameter σ that, at its extremal value, leads to the parity operator. In order to do so, we recall that an important ingredient in the LGI inequality is that correlations C kl are as binary ones, i.e.: where p kl ± are the probabilities of measuring one of the outcomes ±1, and q kl ±|± are the probabilities of obtaining the ± outcomes conditioned to what was previously obtained. Using this fact, Asadian et al. proposed LGI test using the measurement of periodic observables defined in an nanomechanical oscillator [28] and in [29] we showed that Bell type inequalities can be performed using observables with an arbitrary spectrum. In both results, the key ingredient is defining a two-valued POVMM ± , as follows:Ê whereÂ is an operator with a spectrum in the interval [−1, 1]. Using Neumark's theorem [30], we have that each element of this POVM, identified by the signs ±, is associated with one of the two possible outcomes (±1) of a projective measurement realized in an auxiliary two dimensional Hilbert space. OperatorsÂ have thus a spectrum bounded between ±1, since Â = P + − P − and P + + P − = 1, where P ± are the probabilities to obtain one of the two possible outcomes of measurements realized in the auxiliary two dimensional space. We now introduce the following operator, specifying (5), that gathers all the required previously mentioned qualities and properties, and whose parameters are illustrated in Figs. 1 and 2 and explained below: where f µ (m, σ) = e −(m−µ) 2 2σ 2 and ∆m µ are disjoint sets containing equally sized intervals of m. Operator (6) can be seen as an imperfect parity measurement. If f µ (m, σ) = 1 ∀m,Â becomes the parity operator, and E ± are projective measurements. In this case, to each m one assigns a ±1 eigenvalue, according to the parity of j −m. We now see how to interpretÂ in the general case. This will be done by providing a physical meaning to the parameters σ, µ and ∆m µ . They will be associated with the concepts of measurability, optimal measurement, and measurement resolution, respectively.
We start by interpreting ∆m µ in Eq. (6), the measurement resolution. It determines the number N , among all the possible values of m, that the measurement apparatus can faithfully detect. By this, one means: detect the particle and assign to it the correct value of m. Each of these values is defined as µ, the optimal measurement. We have a total of N = (2j + 1)/N (∆m µ ) different values of µ for a spin j system, where N (∆m µ ) is the number of elements in ∆m µ . We see, in Fig. 1, that this corresponds to a perfect Stern-Gerlach type measurement: the z axis projection of the spin with value m = µ is deflected by an angle θ m = θ µ that allows one to identify its hitting position to m univocally. In Eq. (6), it translates as: for m = µ, f µ (m, σ) = 1 irrespectively of the value of σ. Thus, a correct and well defined parity is associated with this values of m, i.e., Â m=µ = (−1) (j−m) = Π z m=µ = ±1. The measurement resolution ∆m µ also defines the interval of values of m that are considered around each µ: each interval ∆m µ defines the domain of a function f µ (m, σ).
We now define the parameter σ, the measurability. Later, we will see that it can be related to the invasiveness. σ is a measure of the unfaithfulness of the measurement. By unfaithfulness, one means the following scenario: for finite σ and m = µ, the particle is detected, but the value of m cannot be perfectly determined. Thus, it will be sometimes associated with the correct value, or to a value with the same parity (and then the correct parity will be assigned to it) and sometimes associated with a m with different parity. As a consequence, for m = µ, one cannot assign a well defined parity, and . Notice that, in particular, for σ such that f µ (µ + 1, σ) = 0, Â m =µ = 0 and Ê ± = 1/2: we have the equivalent of a perfectly random parity measurement. Physically, unfaithfulness in the measurement could arise, in the context of a Stern-Gerlach type experiment, as a consequence of position dependent fluctuations of the magnetic field, that can create an uncertainty ∆θ m in the deflection angle depending on the value of m. All these parameters are illustrated in Fig. 2, where we plotted g ≡ f µ (m, σ), with N (∆m µ ) = 3, σ = 0.6 and one has three different values of µ for the considered system. We conclude this discussion by noticing that the limit of σ → ∞ (perfect measurability) is equivalent to the one of perfect resolution (f µ (m, σ) = 1∀m, N (∆m µ ) = 1), since all the values of m are associated to a µ, and N = 2j + 1.
We now move to an example that illustrates how the introduced parameters can control the invasiveness of a measurement in a way that is dimension and model independent. We then discuss how they can be modified, depending on the experimental situation, by the system's dimensionality or measurement efficiency. To this effect, we notice that the probabilities appearing in Eq. (5) can be written, for a given pair of measurement times t k , t l , as: where we have used Eq. (2), withÛ (t k − t l ) = e −iθ klĴx , with θ kl = ω(t k − t l ). Thus, withρ Using [31], correlations C kl can be computed, and we will do so in a simple illustrative example of a spin j = 5/2 (a six level system). In order to be able to identify the above introduced parameters, we will consider that there are only two possible values of µ, µ ± = ±5/2, and ∆m µ± = [±5/2, 0] (intersection between the two sets is unimportant, since 0 is not a possible value of m). The interval ∆mµ is the resolution of the measurement, in the sense that it determines the number of µ's that can be faithfully measured (i.e., are associated to a fixed position in the screen).
In this simple example, we can identify three possible values of f µ± (m, σ), a, b and c, that obey the following relations: a = 1 and c = b 4 , with b = e −1/2σ 2 , since the f µ± (m, σ) considered here is a gaussian distribution centered at µ ± .
It is clear that modifying σ leads to a modification of b and c only (a is constant, as previously defined). Thus, for σ 1, only µ ± = ±5/2 are faithfully measured while for σ → ∞ the operatorÂ tends to a parity measurement.
We computed K LG as a function of b (which here, equivalently to σ, is related to the measurability) and of time. We considered, for simplifying and illustrative reasons, only measurement times such that k = l + 1 and define θ l+1l ≡ θ. Results are plotted in Fig. 4. One can notice that the absolute value of K LG increases monotonically with b for the cases where the inequality is violated for some b. Nonetheless, its maximum is always reached for b = 1, which corresponds to σ → ∞. In this situation, we retrieve the parity operatorΠ z , and we have perfect measurability and measurement resolution.
We can thus associate invasiveness to measurability: the more a system is measurable, in the sense that the more one can faithfully detect different values of m (higher value of b), the more the LGI is violated. Measurability is a dimension independent definition, but it can perfectly well depend on the dimensionality of a system in a similar way as in [23]. By making ∆m µ increase faster with j than σ, one can, with increasing j, lose vio- lation of the LG inequality. In the present measurement model, this can be understood easily as a increase of the measurability that is slower than the the increase in resolution (increase of σ slower than of ∆m µ ). Nevertheless, such a behavior can be observed irrespectively of the dimension of the system. Finally, one should notice that our model can also be interpreted as a measure of disturbance of a measurement: unfaithful measurements can also be modeled by a measurement that highly disturbs the system, i.e., modifies the value of m after measuring it. Consequently, a value of m is assigned to a state but, after the measurement process, it is no longer applicable. In this context, our model easily connects the introduced parameters to the notion of classical back action and disturbance of a measurement. The more classical back action is introduced, the less the LGI is violated, excluding the possibility of the clumsiness loophole [32].

IV. CONCLUSION
As a conclusion we provided a toy model where the violation of the LGI can be directly controlled by and understood through physically sound parameters. These parameters can be associated to the unfaithfulness of a measurement, a notion that can have different physical origins, all of them contemplated in the introduced model. One example is the increase of dimensionality of the system and another one is the classical disturbance created by the measurement process. While each parameters' precise interpretation depends on the physical system one uses to test a LGI, the role of each parameter is clearly identified and related to the invasiveness, whatever its physical origin is. Thus, this notion is shown to be, operationally, the most fundamental one that is tested in a LGI. Our model can be used to help understanding and interpretation of LGI tests, and can be tested experimentally in a number of physical systems, as Stern-Gerlach like experiments with inhomogeneous fields, or the orbital angular momentum of photons.