sf.apps.qchem.dynamics.marginals

marginals(mu, V, n_max, hbar=2.0)[source]

Generate single-mode marginal distributions from the displacement vector and covariance matrix of a Gaussian state.

Example usage:

>>> mu = np.array([0.00000000, 2.82842712, 0.00000000,
>>>                0.00000000, 0.00000000, 0.00000000])
>>> V = np.array([[1.0, 0.0, 0.0, 0.0, 0.0, 0.0],
>>>               [0.0, 1.0, 0.0, 0.0, 0.0, 0.0],
>>>               [0.0, 0.0, 1.0, 0.0, 0.0, 0.0],
>>>               [0.0, 0.0, 0.0, 1.0, 0.0, 0.0],
>>>               [0.0, 0.0, 0.0, 0.0, 1.0, 0.0],
>>>               [0.0, 0.0, 0.0, 0.0, 0.0, 1.0]])
>>> n_max = 10
>>> marginals(mu, V, n_max)
array([[1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
        0.00000000e+00, 0.00000000e+00],
       [1.35335284e-01, 2.70670567e-01, 2.70670566e-01, 1.80447044e-01,
        9.02235216e-02, 3.60894085e-02, 1.20298028e-02, 3.43708650e-03,
        8.59271622e-04, 1.90949249e-04],
       [1.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
        0.00000000e+00, 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
        0.00000000e+00, 0.00000000e+00]])
Parameters
  • mu (array) – displacement vector

  • V (array) – covariance matrix

  • n_max (int) – maximum number of vibrational quanta in the distribution

  • hbar (float) – the value of \(\hbar\) in the commutation relation \([\x,\p]=i\hbar\).

Returns

marginal distributions

Return type

array[list[float]]