From ff9b8bb838ecdfbfc1dc81038fcf3b2a87636982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Zrounba?= <6691770+clement-z@users.noreply.github.com> Date: Sat, 30 Sep 2023 23:06:01 +0200 Subject: Initial release --- src/devices/mesh_col.h | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/devices/mesh_col.h (limited to 'src/devices/mesh_col.h') diff --git a/src/devices/mesh_col.h b/src/devices/mesh_col.h new file mode 100644 index 0000000..e0a6066 --- /dev/null +++ b/src/devices/mesh_col.h @@ -0,0 +1,76 @@ +#pragma once + +#include +#include +#include +#include +#include + +/** + * This class implements a single column of an MZI mesh + * specified in the work: Optimal design for universal multiport interferometers + * by Clements et al. (2016). +*/ + +class MeshCol : public spx_module{ +public: + // Ports + vector> p_in; + vector> p_out; + vector>> p_vphi; + vector>> p_vtheta; + + // Member variables + size_t m_N; // represents the number of inputs of the mesh (rows) + size_t m_j; // represents the current row being evaluated + + // 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 + vector> m_mzi; + vector> m_wg; + + + // Initialization functions + void init_ports(); + void init(); + + void init_N_even_j_even(); + void init_N_even_j_odd(); + + void init_N_odd_j_even(); + void init_N_odd_j_odd(); + + /** Constructor for MZI Mesh Column + * + * @param name name of the module + * @param N number of rows contained in the module + * @param j current column being created, from 0 to N-1 + * */ + MeshCol(sc_module_name name, const size_t &N, const size_t &j, + 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_j(j) + , 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); + assert(j < N); + + init_ports(); + } +}; \ No newline at end of file -- cgit v1.2.3