Hi,

I was reading Strawberry Fields source code on GitHub and I found something that captured my attention. In

```
# Copyright 2019 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Gaussian circuit operations"""
# pylint: disable=duplicate-code,attribute-defined-outside-init
import numpy as np
from . import ops
from ..shared_ops import changebasis
```

This file has been truncated. show original

I see that you define the covariance matrices in term of two matrices N and M: what do they represent? In which way are they related to the “standard” covariance matrix for the Wigner function?

Thanks in advance!

Hi Valeria — Thanks for you question. The M and N matrices are the normal ordered moments of the destruction operators.

As described in lines 39-40 of the file you mentioned they are defined as

N_{i,j} =\langle a_i^\dagger a_j \rangle
M_{i,j} = \langle a_i a_j \rangle

They have the nice property of being independent of \hbar and are zero for the multimode vacuum state.

They are also related to the A and B matrices in Eq. 2.37 of the classical paper by Simon, Mukunda and Dutta (https://journals.aps.org/pra/abstract/10.1103/PhysRevA.49.1567 )

If you want to convert between M and N and the standard quadrature covariance matrix V you can use the method `scovmaxp`

to go from M and N to V and you can use `fromscovmat`

to do the opposite.

Also, if you want to play directly with the standard covariance matrices in the quadrature formalism I’d recommend you to have a look at the `symplectic`

module of The Walrus (cf. https://the-walrus.readthedocs.io/en/latest/code/symplectic.html )

Hope this answers your question,

Nicolas

3 Likes

Dear Nicolas,
thank you for your reply, it is exactly what I was looking for.
Cheers,
Valeria

3 Likes