aboutsummaryrefslogtreecommitdiff
path: root/sympmat.m
diff options
context:
space:
mode:
Diffstat (limited to 'sympmat.m')
-rw-r--r--sympmat.m12
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
+