flamingpy.cv.ops.SCZ_mat

flamingpy.cv.ops.SCZ_mat(adj, sparse=True)[source]

Return a symplectic matrix corresponding to CZ gate application.

Give the 2N by 2N symplectic matrix for CZ gate application based on the adjacency matrix adj. Assumes quadrature-like convention:

(q1, …, qN, p_1, …, p_N).

Parameters
  • adj (array) – N by N binary symmetric matrix. If modes i and j are linked by a CZ, then entry ij and ji is equal to the weight of the edge (1 by default); otherwise 0.

  • sparse (bool) – whether to return a sparse or dense array when adj input is a sparse array.

Returns

2N by 2N symplectic matrix.

sparse if the adjacency matrix is sparse.

Return type

np.array or sp.sparse.csr_matrix

Contents

Home

Background

Using FlamingPy

Development

Getting Help

Python API