# How do we obtain the expectation value between 2 qubits?

In the Science paper, **Phase transitions in a programmable quantum spin glass simulator, **they mention that the D-wave processor can easily determine the correlation function between two spins (see eqn. 4, and figure S11).

What are the commands to specify this output?

## Comments

Andrew B(Report)In Fig. S11 we discuss the spin spin correlations found from classical samples taken at the end of a quenched anneal. To calculate this let us start with some notation. Take a set of C classical samples, call them S^i for i in 1..C (^ meaning superscript). The value of a spin j in sample S^i is referred to as S^i_j (_j being subscript) and can be +1 or -1. Then, to calculate the spin spin correlation of spin m with spin n calculate sum_{i = 1..C} (S^i_m * S^j_n) / C. For a perfect anti-ferromagnetic and averaged across all nearest neighbor pairs you should get -1. For a perfect ferromagnetic, you should get 1. Eqn. 4, on the other hand, describes how to calculate a more interesting parameter, the spin spin overlap where one calculates intersample correlations for each spin instead of intrasample correlations between spins.

The high level work flow is setup a set of couplings to describe the spin system you want, then take a set of samples using either a simple forward anneal over some time, or a more complicated pause / quench. Then calculate the above on the results.

Cris C(Report)Thank you for the response, Andrew. It definitely clears everything up.

Please sign in to leave a comment.