diff options
author | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-11-19 13:00:14 -0500 |
---|---|---|
committer | Eugeniy E. Mikhailov <evgmik@gmail.com> | 2024-11-19 13:00:14 -0500 |
commit | 6187aede8dc13a4fc4d5fd5463574955d702d7f4 (patch) | |
tree | 26767b68a7df52a8cef24cb74cc88453d42725c8 /sympmat.m | |
download | matlab_strawberryfields-6187aede8dc13a4fc4d5fd5463574955d702d7f4.tar.gz matlab_strawberryfields-6187aede8dc13a4fc4d5fd5463574955d702d7f4.zip |
initial release
Diffstat (limited to 'sympmat.m')
-rw-r--r-- | sympmat.m | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sympmat.m b/sympmat.m new file mode 100644 index 0000000..9eb84db --- /dev/null +++ b/sympmat.m @@ -0,0 +1,12 @@ +function omega = sympmat(n) + % Create a symplectic form matrix + % Note that it is assumed that the symplectic form is + % + %.. math:: \Omega = \begin{bmatrix}0&I\\-I&0\end{bmatrix} + % + % where :math:`I` is the identity matrix and :math:`0` is the zero matrix. + I = eye(n); + Z = zeros(n); + omega = [Z I; -I Z]; +end + |