aboutsummaryrefslogtreecommitdiff
path: root/src/devices/clements.h
diff options
context:
space:
mode:
authorClément Zrounba <6691770+clement-z@users.noreply.github.com>2023-09-30 23:06:01 +0200
committerClément Zrounba <6691770+clement-z@users.noreply.github.com>2023-09-30 23:26:46 +0200
commitff9b8bb838ecdfbfc1dc81038fcf3b2a87636982 (patch)
tree21f27be782ce11c6d00b96ce100a2bff88141b2e /src/devices/clements.h
downloadspecs-ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982.tar.gz
specs-ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982.zip
Initial release
Diffstat (limited to 'src/devices/clements.h')
-rw-r--r--src/devices/clements.h66
1 files changed, 66 insertions, 0 deletions
diff --git a/src/devices/clements.h b/src/devices/clements.h
new file mode 100644
index 0000000..78de99f
--- /dev/null
+++ b/src/devices/clements.h
@@ -0,0 +1,66 @@
+#pragma once
+
+#include <specs.h>
+#include <spx_module.h>
+#include <mesh_col.h>
+
+/* Clements MZI Mesh
+
+The mesh has a total of N(N-1)/2 MZIs, as specified in
+Optimal design for universal multiport interferometers by Clements et al. (2016).
+
+Connection guide (above the X is electrical address of phi/theta):
+ 0 3
+ 0__| __ ______ __| __ ______0
+ \/ 2 \/ 5
+ 1__/\__ __| __ __/\__ __| __1
+ 1 \/ 4 \/
+ 2__| __ __/\__ __| __ __/\__2
+ \/ \/
+ 3__/\__ ______ __/\__ ______3
+*/
+
+class Clements : public spx_module{
+public:
+ vector<unique_ptr<spx::oa_port_in_type>> p_in;
+ vector<unique_ptr<spx::oa_port_out_type>> p_out;
+ vector<unique_ptr<sc_in<double>>> p_vphi;
+ vector<unique_ptr<sc_in<double>>> p_vtheta;
+
+ // Member variables
+ size_t m_N; // represents the number of inputs of the mesh (rows)
+
+ // Parameters for the internal MZIs
+ double m_length_cm;
+ double m_attenuation_wg_dB_cm;
+ double m_attenuation_coupler_dB;
+ double m_attenuation_ps_dB;
+ double m_neff;
+ double m_ng;
+
+ // Submodules and wires
+ vector<unique_ptr<spx::oa_signal_type>> m_optical_connect;
+ vector<unique_ptr<MeshCol>> m_mesh_cols;
+
+ // Initialization functions
+ void init_ports();
+ void init();
+
+ Clements(sc_module_name name, const size_t &N,
+ const double &length_cm = 1e-2,
+ const double &attenuation_wg_dB_cm = 0, const double &attenuation_coupler_dB = 0,
+ const double &attenuation_ps_dB = 0,
+ const double &neff = 2.2111, const double &ng = 2.2637)
+ : spx_module(name)
+ , m_N(N)
+ , m_length_cm(length_cm)
+ , m_attenuation_wg_dB_cm(attenuation_wg_dB_cm)
+ , m_attenuation_coupler_dB(attenuation_coupler_dB)
+ , m_attenuation_ps_dB(attenuation_ps_dB)
+ , m_neff(neff)
+ , m_ng(ng)
+ {
+ assert(N > 1);
+ init_ports();
+ }
+}; \ No newline at end of file