├── testcases ├── Direct modulator │ ├── Direct modulator_problem_description.txt │ ├── Direct modulator_ref.json │ └── Direct modulator_res.json ├── OS_2x2 │ ├── OS_2x2_problem_description.txt │ └── OS_2x2_ref.json ├── Spanke_4x4 │ ├── Spanke_4x4_problem_description.txt │ └── Spanke_4x4_ref.json ├── Spanke_8x8 │ ├── Spanke_8x8_problem_description.txt │ └── Spanke_8x8_ref.json ├── NLS │ ├── NLS_problem_description.txt │ └── NLS_ref.json ├── U-matrix_block │ ├── U-matrix_block_problem_description.txt │ └── U-matrix_block_ref.json ├── Crossbar_4x4 │ ├── Crossbar_4x4_problem_description.txt │ └── Crossbar_4x4_ref.json ├── Crossbar_8x8 │ ├── Crossbar_8x8_problem_description.txt │ └── Crossbar_8x8_ref.json ├── MZM │ ├── MZM_problem_description.txt │ ├── MZM_ref.json │ └── MZM_res.json ├── Benes_4x4 │ ├── Benes_4x4_problem_description.txt │ └── Benes_4x4_ref.json ├── Benes_8x8 │ ├── Benes_8x8_problem_description.txt │ └── Benes_8x8_ref.json ├── MZI_ps │ ├── MZI_ps_problem_description.txt │ ├── MZI_ps_ref.json │ └── MZI_ps_res.json ├── Spanke–Benes_4x4 │ ├── Spanke–Benes_4x4_problem_description.txt │ └── Spanke–Benes_4x4_ref.json ├── Spanke–Benes_8x8 │ ├── Spanke–Benes_8x8_problem_description.txt │ └── Spanke–Benes_8x8_ref.json ├── Reck_4x4 │ ├── Reck_4x4_problem_description.txt │ └── Reck_4x4_ref.json ├── Reck_8x8 │ ├── Reck_8x8_problem_description.txt │ └── Reck_8x8_ref.json ├── Clements_4x4 │ ├── Clements_4x4_problem_description.txt │ └── Clements_4x4_ref.json ├── Clements_8x8 │ ├── Clements_8x8_problem_description.txt │ └── Clements_8x8_ref.json ├── WDM_mux │ ├── WDM_mux_problem_description.txt │ └── WDM_mux_ref.json ├── WDM_demux │ ├── WDM_demux_problem_description.txt │ ├── WDM_demux_ref.json │ └── WDM_demux_res.json ├── Optical hybrid │ ├── Optical hybrid_problem_description.txt │ └── Optical hybrid_ref.json ├── QPSK modulator │ ├── QPSK modulator_problem_description.txt │ └── QPSK modulator_ref.json ├── 8-QAM modulator │ ├── 8-QAM modulator_ref.json │ ├── 8-QAM modulator_problem_description.txt │ └── 8-QAM modulator_res.json └── 64-QAM modulator │ ├── 64-QAM modulator_ref.json │ ├── 64-QAM modulator_problem_description.txt │ └── 64-QAM modulator_res.json ├── LICENSE ├── PICBench ├── restrictions.txt ├── system_prompt.txt ├── evaluation.py ├── devices.py ├── agent.py └── gen_data.py └── README.md /testcases/Direct modulator/Direct modulator_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Direct modulator: 2 | 3 | Design an optical direct modulator using single drive Mach-Zehnder Modulators (MZMs). The circuit should have only one input and one output, and employ the MZM to modulate the signal. Use a built-in components called mzm to represent the single drive Mach-Zehnder modulators. -------------------------------------------------------------------------------- /testcases/OS_2x2/OS_2x2_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-OS_2x2: 2 | 3 | Design a 2x2 optical switch using built-in coupler components and phase shifters. By incorporating built-in multimode interferometer (MMI) components and 4 adjustable phase shifters, the switch should be able to alternate between the cross and bar states, effectively controlling the switching operation. -------------------------------------------------------------------------------- /testcases/Spanke_4x4/Spanke_4x4_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Spanke_4x4: 2 | 3 | Design an NxN optical switching network based on the Spanke architecture, ensuring strict-sense non-blocking switching between N input and N output ports. The network should use 2N x (N-1) built-in Multimode Interferometer (MMI) components and consist of a combination of N 1xN switches and N Nx1 switches. 4 | 5 | Parameters:N=4 -------------------------------------------------------------------------------- /testcases/Spanke_8x8/Spanke_8x8_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Spanke_8x8: 2 | 3 | Design an NxN optical switching network based on the Spanke architecture, ensuring strict-sense non-blocking switching between N input and N output ports. The network should use 2N x (N-1) built-in Multimode Interferometer (MMI) components and consist of a combination of N 1xN switches and N Nx1 switches. 4 | 5 | Parameters:N=8 -------------------------------------------------------------------------------- /testcases/Direct modulator/Direct modulator_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "mzm_bit": "mzm", 6 | "waveguide": "straight" 7 | }, 8 | "connections": { 9 | "mzm_bit,O1": "waveguide,I1" 10 | }, 11 | "ports": { 12 | "I1": "mzm_bit,I1", 13 | "O1": "waveguide,O1" 14 | } 15 | }, 16 | "models": { 17 | "mzm": "mzm", 18 | "straight": "straight" 19 | } 20 | } -------------------------------------------------------------------------------- /testcases/NLS/NLS_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-NLS: 2 | 3 | Design a Non-Linear Sign (NLS) gate with a single signal channel and two additional ancilla channels, featuring three inputs and three outputs. The gate should employ built-in couplers to create a quantum logic operation and a phase shift of ϕ is applied to the signal channel to ensure a non-deterministic nonlinear sign change on a specific mode. 4 | 5 | Parameters: ϕ: 180° -------------------------------------------------------------------------------- /testcases/U-matrix_block/U-matrix_block_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-U-matrix_block: 2 | 3 | Design a fundamental block that represents a 2x2 unitary matrix of arbitrary values using integrated photonic components. The block should be built based the built-in coupler component. Each coupler should incorporate adjustable phase shifters to control the interference and routing of optical signals to achieve the desired unitary transformation -------------------------------------------------------------------------------- /testcases/Crossbar_4x4/Crossbar_4x4_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Crossbar_4x4: 2 | 3 | Design a NxN optical switching network based on the crossbar architecture. The switch should enable wide-sense non-blocking switching between N input ports and N output ports using NxN 2x2 optical switches in a full matrix configuration characteristic of the crossbar topology. Use a built-in components called OSU to represent the 2x2 optical switching unit. 4 | 5 | Parameters:N=4 -------------------------------------------------------------------------------- /testcases/Crossbar_8x8/Crossbar_8x8_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Crossbar_8x8: 2 | 3 | Design a NxN optical switching network based on the crossbar architecture. The switch should enable wide-sense non-blocking switching between N input ports and N output ports using NxN 2x2 optical switches in a full matrix configuration characteristic of the crossbar topology. Use a built-in components called OSU to represent the 2x2 optical switching unit. 4 | 5 | Parameters:N=8 -------------------------------------------------------------------------------- /testcases/MZM/MZM_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-MZM: 2 | 3 | Create a Mach-Zehnder Modulator (MZM) which have a single optical input and a single optical output. The phase shifters with a length of L should be applied to the two arms to modulate the phase of the optical signal. Use the built-in multimode interferometer (MMI) component for splitting and combining the optical signals, and the built-in phase shifters to achieve the desired phase modulation. 4 | 5 | Parameters:L=10 microns -------------------------------------------------------------------------------- /testcases/Benes_4x4/Benes_4x4_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Benes_4x4: 2 | 3 | Design an NxN optical switching network based on the Benes architecture, ensuring rearrangeably nonblocking switching between N input and N output ports. The network should use (N/2x((log₂(N))−1)) 2x2 optical switching units and consist of (2xlog₂(N))−1) stages, each with N/2 2x2 optical switching units. Use a built-in components called OSU to represent the 2x2 optical switching unit. 4 | 5 | Parameters:N=4 6 | -------------------------------------------------------------------------------- /testcases/Benes_8x8/Benes_8x8_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Benes_8x8: 2 | 3 | Design an NxN optical switching network based on the Benes architecture, ensuring rearrangeably nonblocking switching between N input and N output ports. The network should use (N/2x((log₂(N))−1)) 2x2 optical switching units and consist of (2xlog₂(N))−1) stages, each with N/2 2x2 optical switching units. Use a built-in components called OSU to represent the 2x2 optical switching unit. 4 | 5 | Parameters:N=8 6 | -------------------------------------------------------------------------------- /testcases/MZI_ps/MZI_ps_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-MZI_ps: 2 | 3 | Create a Mach-Zehnder interferometer (MZI) with a single input and output, featuring a path length difference of ΔL. A phase shifters with a length of L should be applied to the top arm to modulate the phase of the optical signal. Use the built-in multimode interferometer (MMI) component for splitting and combining the optical signals, and the built-in phase shifters to achieve the desired phase modulation. 4 | 5 | Parameters: 6 | ΔL=10 microns 7 | L=10 microns -------------------------------------------------------------------------------- /testcases/Spanke–Benes_4x4/Spanke–Benes_4x4_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Spanke–Benes_4x4: 2 | 3 | Design a NxN optical switching network utilizing the Spanke–Benes architecture, a hybrid that combines elements of both Spanke and Benes networks. The switch should enable rearrangeably nonblocking switching between N input ports and N output ports using 2x2 optical switching units arranged in a N-stage planar network. The number of the 2x2 optical switching units used in each stage is N and N-1 alternately. Use a built-in components called OSU to represent the 2x2 optical switching unit. 4 | 5 | Parameters:N=4 -------------------------------------------------------------------------------- /testcases/Spanke–Benes_8x8/Spanke–Benes_8x8_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Spanke–Benes_8x8: 2 | 3 | Design a NxN optical switching network utilizing the Spanke–Benes architecture, a hybrid that combines elements of both Spanke and Benes networks. The switch should enable rearrangeably nonblocking switching between N input ports and N output ports using 2x2 optical switching units arranged in a N-stage planar network. The number of the 2x2 optical switching units used in each stage is N and N-1 alternately. Use a built-in components called OSU to represent the 2x2 optical switching unit. 4 | 5 | Parameters:N=8 -------------------------------------------------------------------------------- /testcases/Reck_4x4/Reck_4x4_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Reck_4x4: 2 | 3 | Design a NxN Mach-Zehnder interferometer (MZI) mesh utilizing the Reck method. The circuit should utilize Nx(N-1)/2 built-in MZI components arranged in a triangular network format to from a reconfigurable optical network capable of perfoming any unitary transformation on N input channels. Each MZI should incorporate adjustable phase shifters to control the interference and routing of optical signals within the mesh. Use a built-in components called mzi_ps to represent the MZI block incorporate adjustable phase shifters. 4 | 5 | Parameters:N=4 -------------------------------------------------------------------------------- /testcases/Reck_8x8/Reck_8x8_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Reck_8x8: 2 | 3 | Design a NxN Mach-Zehnder interferometer (MZI) mesh utilizing the Reck method. The circuit should utilize Nx(N-1)/2 built-in MZI components arranged in a triangular network format to from a reconfigurable optical network capable of perfoming any unitary transformation on N input channels. Each MZI should incorporate adjustable phase shifters to control the interference and routing of optical signals within the mesh. Use a built-in components called mzi_ps to represent the MZI block incorporate adjustable phase shifters. 4 | 5 | Parameters:N=8 -------------------------------------------------------------------------------- /testcases/Clements_4x4/Clements_4x4_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Clements_4x4: 2 | 3 | Design a NxN Mach-Zehnder interferometer (MZI) mesh network utilizing the Clements method. The circuit should utilize Nx(N-1)/2 MZI components arranged in a rectangular network format to from a reconfigurable optical network capable of perfoming any unitary transformation on N input channels. Each MZI should incorporate adjustable phase shifters to control the interference and routing of optical signals within the mesh. Use a built-in components called mzi_ps to represent the MZI block incorporate adjustable phase shifters. 4 | 5 | Parameters:N=4 -------------------------------------------------------------------------------- /testcases/Clements_8x8/Clements_8x8_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Clements_8x8: 2 | 3 | Design a NxN Mach-Zehnder interferometer (MZI) mesh network utilizing the Clements method. The circuit should utilize Nx(N-1)/2 MZI components arranged in a rectangular network format to from a reconfigurable optical network capable of perfoming any unitary transformation on N input channels. Each MZI should incorporate adjustable phase shifters to control the interference and routing of optical signals within the mesh. Use a built-in components called mzi_ps to represent the MZI block incorporate adjustable phase shifters. 4 | 5 | Parameters:N=8 -------------------------------------------------------------------------------- /testcases/WDM_mux/WDM_mux_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-WDM_multiplexer: 2 | 3 | Design an optical WDM multiplexer that combines N channels of optical signals, each at a distinct wavelength, into a single optical fiber for transmission. The multiplexer will utilize a series of built-in add/drop Micro Ring Resonators, each operating at a unique wavelength cwl. The output will be a composite optical signal encompassing all N wavelengths, enabling simultaneous transmission of multiple data channels over a single fiber. The circuit should have N inputs for each input signal and only one output. 4 | 5 | Parameters: 6 | N=4; 7 | cwl1=1.543; 8 | cwl2=1.550; 9 | cwl3=1.554; 10 | cwl4=1.556; -------------------------------------------------------------------------------- /testcases/WDM_demux/WDM_demux_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-WDM_demultiplexer: 2 | 3 | Design an optical WDM demultiplexer that separates a composite optical signal into N individual wavelength channels for processing and analysis. The multiplexer will utilize a series of built-in add/drop Micro Ring Resonators to efficiently extract N distinct wavelength channels from a single input fiber, corresponding to the wavelengths cwl. The design will ensure precise alignment of the optical paths to effectively isolate and direct each wavelength to its designated output port. The circuit should only have one inputs and one output. 4 | 5 | Parameters: 6 | N=4; 7 | cwl1=1.543; 8 | cwl2=1.550; 9 | cwl3=1.554; 10 | cwl4=1.556; 11 | -------------------------------------------------------------------------------- /testcases/Optical hybrid/Optical hybrid_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-Optical hybrid: 2 | 3 | Design a 90-degree optical hybrid using Multimode Interferometer (MMI) components and coupler components. The optical hybrid should have two optical inputs and four outputs. It is intended to combine the signals from a local oscillator and a received signal for coherent detection. By utilizing built-in Multimode Interferometer (MMI) components and coupler components, the design should mix the input signals to produce the in-phase (I) and quadrature-phase (Q) components, as well as their negative counterparts, enabling effective separation of the amplitude and phase information of the received signal. A phase shifter should be used to achieve the desired phase. -------------------------------------------------------------------------------- /testcases/QPSK modulator/QPSK modulator_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-QPSK modulator: 2 | 3 | Design an optical QPSK modulator using single drive Mach-Zehnder Modulators (MZMs) to encode 2 bits per symbol through phase modulation. The circuit should have only one input and one output, and employ the MZMs to modulate the in-phase (I) and quadrature-phase (Q) components of the signal. A 90-degree phase shifter should be used in the path of one of the MZMs, ensuring that the modulation is performed at the correct quadrature points for accurate QPSK encoding. Use the built-in multimode interferometer (MMI) component for splitting and combining the optical signals, and a built-in components called mzm to represent the single drive Mach-Zehnder modulators. -------------------------------------------------------------------------------- /testcases/MZI_ps/MZI_ps_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist":{ 3 | "instances": { 4 | "mmi1": "mmi", 5 | "waveguide1": {"component": "waveguide", "settings": {"length": 20.0}}, 6 | "phase_shifter": {"component": "straight_heat_metal", "settings": {"length": 10.0}}, 7 | "mmi2": "mmi" 8 | }, 9 | "connections": { 10 | "mmi1,O1": "phase_shifter,I1", 11 | "phase_shifter,O1": "mmi2,O1", 12 | "mmi1,O2": "waveguide1,I1", 13 | "waveguide1,O1": "mmi2,O2" 14 | }, 15 | "ports": { 16 | "I1":"mmi1,I1", 17 | "O1":"mmi2,I1" 18 | } 19 | }, 20 | "models":{ 21 | "mmi": "mmi1x2", 22 | "waveguide": "straight", 23 | "straight_heat_metal": "straight_heat_metal" 24 | } 25 | } -------------------------------------------------------------------------------- /testcases/U-matrix_block/U-matrix_block_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "coupler1": "coupler", 6 | "coupler2": "coupler", 7 | "phase_shifter1": "straight_heat_metal", 8 | "phase_shifter2": "straight_heat_metal" 9 | }, 10 | "connections": { 11 | "phase_shifter1,O1": "coupler1,I1", 12 | "coupler1,O1": "phase_shifter2,I1", 13 | "phase_shifter2,O1": "coupler2,I1", 14 | "coupler1,O2": "coupler2,I2" 15 | }, 16 | "ports": { 17 | "I1": "phase_shifter1,I1", 18 | "I2": "coupler1,I2", 19 | "O1": "coupler2,O1", 20 | "O2": "coupler2,O2" 21 | } 22 | }, 23 | "models": { 24 | "coupler": "coupler", 25 | "straight_heat_metal": "straight_heat_metal" 26 | } 27 | } -------------------------------------------------------------------------------- /testcases/QPSK modulator/QPSK modulator_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "mzm_I": "mzm", 6 | "mzm_Q": "mzm", 7 | "splitter": "mmi", 8 | "combiner": "mmi", 9 | "phase_shifter": { "component": "straight_heat_metal", "settings": {"phase": 90}} 10 | }, 11 | "connections": { 12 | "splitter,O1": "mzm_I,I1", 13 | "splitter,O2": "mzm_Q,I1", 14 | "mzm_I,O1": "combiner,O1", 15 | "mzm_Q,O1": "phase_shifter,I1", 16 | "phase_shifter,O1": "combiner,O2" 17 | }, 18 | "ports": { 19 | "I1": "splitter,I1", 20 | "O1": "combiner,I1" 21 | } 22 | }, 23 | "models": { 24 | "mzm": "mzm", 25 | "mmi": "mmi1x2", 26 | "straight_heat_metal": "straight_heat_metal" 27 | } 28 | } -------------------------------------------------------------------------------- /testcases/MZM/MZM_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist":{ 3 | "instances": { 4 | "splitter": "mmi", 5 | "combiner": "mmi", 6 | "phase_shifter1": {"component": "straight_heat_metal", "settings": {"length": 10.0}}, 7 | "phase_shifter2": {"component": "straight_heat_metal", "settings": {"length": 10.0}} 8 | }, 9 | "connections": { 10 | "splitter,O1": "phase_shifter1,I1", 11 | "splitter,O2": "phase_shifter2,I1", 12 | "phase_shifter1,O1": "combiner,O1", 13 | "phase_shifter2,O1": "combiner,O2" 14 | }, 15 | "ports": { 16 | "I1":"splitter,I1", 17 | "O1":"combiner,I1" 18 | } 19 | }, 20 | "models":{ 21 | "mmi": "mmi1x2", 22 | "straight_heat_metal": "straight_heat_metal" 23 | } 24 | } -------------------------------------------------------------------------------- /testcases/NLS/NLS_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist":{ 3 | "instances": { 4 | "coupler1": "coupler", 5 | "coupler2": "coupler", 6 | "coupler3": "coupler", 7 | "phase_shifter": {"component": "straight_heat_metal", "settings": {"phase": 180}} 8 | }, 9 | "connections": { 10 | "phase_shifter,O1": "coupler1,I1", 11 | "coupler2,O1": "coupler1,I2", 12 | "coupler1,O2": "coupler3,I1", 13 | "coupler2,O2": "coupler3,I2" 14 | }, 15 | "ports": { 16 | "I1":"phase_shifter,I1", 17 | "I2":"coupler2,I1", 18 | "I3":"coupler2,I2", 19 | "O1":"coupler1,O1", 20 | "O2":"coupler3,O1", 21 | "O3":"coupler3,O2" 22 | } 23 | }, 24 | "models":{ 25 | "coupler": "coupler", 26 | "straight_heat_metal": "straight_heat_metal" 27 | } 28 | } -------------------------------------------------------------------------------- /testcases/8-QAM modulator/8-QAM modulator_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "mzm_bit1": "mzm", 6 | "mzm_bit2": "mzm", 7 | "mzm_bit3": "mzm", 8 | "splitter1": "mmi", 9 | "splitter2": "mmi", 10 | "combiner1": "mmi", 11 | "combiner2": "mmi" 12 | }, 13 | "connections": { 14 | "splitter1,O1": "splitter2,I1", 15 | "splitter2,O1": "mzm_bit1,I1", 16 | "splitter2,O2": "mzm_bit2,I1", 17 | "splitter1,O2": "mzm_bit3,I1", 18 | 19 | "mzm_bit1,O1": "combiner1,O1", 20 | "mzm_bit2,O1": "combiner1,O2", 21 | "mzm_bit3,O1": "combiner2,O1", 22 | "combiner1,I1": "combiner2,O2" 23 | }, 24 | "ports": { 25 | "I1": "splitter1,I1", 26 | "O1": "combiner2,I1" 27 | } 28 | }, 29 | "models": { 30 | "mzm": "mzm", 31 | "mmi": "mmi1x2" 32 | } 33 | } -------------------------------------------------------------------------------- /testcases/Optical hybrid/Optical hybrid_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "mmi1": "mmi", 6 | "mmi2": "mmi", 7 | "coupler1": "coupler", 8 | "coupler2": "coupler", 9 | "phase_shifter": "straight_heat_metal" 10 | }, 11 | "connections": { 12 | "mmi1,O1": "coupler1,I1", 13 | "mmi1,O2": "coupler2,I1", 14 | "mmi2,O1": "coupler1,I2", 15 | "mmi2,O2": "phase_shifter,I1", 16 | "phase_shifter,O1": "coupler2,I2" 17 | }, 18 | "ports": { 19 | "I1": "mmi1,I1", 20 | "I2": "mmi2,I1", 21 | "O1": "coupler1,O1", 22 | "O2": "coupler1,O2", 23 | "O3": "coupler2,O1", 24 | "O4": "coupler2,O2" 25 | 26 | } 27 | }, 28 | "models": { 29 | "coupler": "coupler", 30 | "straight_heat_metal": "straight_heat_metal", 31 | "mmi": "mmi1x2" 32 | } 33 | } -------------------------------------------------------------------------------- /testcases/64-QAM modulator/64-QAM modulator_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "mzm_bit1": "mzm_dual", 6 | "mzm_bit2": "mzm_dual", 7 | "mzm_bit3": "mzm_dual", 8 | "splitter1": "mmi", 9 | "splitter2": "mmi", 10 | "combiner1": "mmi", 11 | "combiner2": "mmi" 12 | }, 13 | "connections": { 14 | "splitter1,O1": "splitter2,I1", 15 | "splitter2,O1": "mzm_bit1,I1", 16 | "splitter2,O2": "mzm_bit2,I1", 17 | "splitter1,O2": "mzm_bit3,I1", 18 | 19 | "mzm_bit1,O1": "combiner1,O1", 20 | "mzm_bit2,O1": "combiner1,O2", 21 | "mzm_bit3,O1": "combiner2,O1", 22 | "combiner1,I1": "combiner2,O2" 23 | }, 24 | "ports": { 25 | "I1": "splitter1,I1", 26 | "O1": "combiner2,I1" 27 | } 28 | }, 29 | "models": { 30 | "mzm_dual": "mzm_dual", 31 | "mmi": "mmi1x2" 32 | } 33 | } -------------------------------------------------------------------------------- /testcases/8-QAM modulator/8-QAM modulator_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-8-QAM modulator: 2 | 3 | Design an optical 8-QAM transmitter using single drive Mach-Zehnder Modulators (MZMs) in a parallel configuration to encode 3 bits per symbol simultaneously. The modulator should have only one input and one output. The input will be split into the parallel MZMs, each responsible for modulating one of the binary bits into corresponding optical phase states, with the appropriate phase shift applied to create the desired quadrature phase modulation. The output of the modulating arms will be combined to produce the final 8-QAM signal, which varies both in amplitude and phase for each symbol transition. Use the built-in multimode interferometer (MMI) component for splitting and combining the optical signals, and a built-in component called mzm to represent the single drive Mach-Zehnder modulators. -------------------------------------------------------------------------------- /testcases/64-QAM modulator/64-QAM modulator_problem_description.txt: -------------------------------------------------------------------------------- 1 | Problem Description-64-QAM modulator: 2 | 3 | Design an optical 64-QAM transmitter using dual drive Mach-Zehnder Modulators (MZMs) in a parallel configuration to encode 6 bits per symbol simultaneously. The modulator should have only one input and one output. The input will be split into the parallel MZMs, each responsible for modulating two of the binary bits into corresponding optical phase states, with the appropriate phase shift applied to create the desired quadrature phase modulation. The output of the modulating arms will be combined to produce the final 64-QAM signal, which varies both in amplitude and phase for each symbol transition. Use the built-in multimode interferometer (MMI) component for splitting and combining the optical signals, and a built-in component called mzm_dual to represent the dual drive Mach-Zehnder modulators. -------------------------------------------------------------------------------- /testcases/WDM_demux/WDM_demux_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "ring1": {"component": "mrr", "settings": {"cwl": 1.543}}, 6 | "ring2": {"component": "mrr", "settings": {"cwl": 1.55}}, 7 | "ring3": {"component": "mrr", "settings": {"cwl": 1.554}}, 8 | "ring4": {"component": "mrr", "settings": {"cwl": 1.556}}, 9 | "waveguide1": "waveguide", 10 | "waveguide2": "waveguide", 11 | "waveguide3": "waveguide" 12 | }, 13 | "connections": { 14 | "ring1,O1": "waveguide1,I1", 15 | "waveguide1,O1": "ring2,I1", 16 | "ring2,O1": "waveguide2,I1", 17 | "waveguide2,O1": "ring3,I1", 18 | "ring3,O1": "waveguide3,I1", 19 | "waveguide3,O1": "ring4,I1" 20 | }, 21 | "ports": { 22 | "I1": "ring1,I1", 23 | "O1": "ring4,O1" 24 | } 25 | }, 26 | "models": { 27 | "mrr": "mrr", 28 | "waveguide": "straight" 29 | } 30 | } -------------------------------------------------------------------------------- /testcases/Benes_4x4/Benes_4x4_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "OSU1": "osu", 5 | "OSU2": "osu", 6 | "OSU3": "osu", 7 | "OSU4": "osu", 8 | "OSU5": "osu", 9 | "OSU6": "osu" 10 | }, 11 | "connections": { 12 | "OSU1,O1": "OSU3,I1", 13 | "OSU1,O2": "OSU4,I1", 14 | "OSU2,O1": "OSU3,I2", 15 | "OSU2,O2": "OSU4,I2", 16 | "OSU3,O1": "OSU5,I1", 17 | "OSU3,O2": "OSU6,I1", 18 | "OSU4,O1": "OSU5,I2", 19 | "OSU4,O2": "OSU6,I2" 20 | }, 21 | "ports": { 22 | "I1": "OSU1,I1", 23 | "I2": "OSU1,I2", 24 | "I3": "OSU2,I1", 25 | "I4": "OSU2,I2", 26 | 27 | "O1": "OSU5,O1", 28 | "O2": "OSU5,O2", 29 | "O3": "OSU6,O1", 30 | "O4": "OSU6,O2" 31 | } 32 | }, 33 | "models": { 34 | "osu": "OSU" 35 | } 36 | } -------------------------------------------------------------------------------- /testcases/Spanke–Benes_4x4/Spanke–Benes_4x4_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "OSU1": "OSU", 5 | "OSU2": "OSU", 6 | "OSU3": "OSU", 7 | "OSU4": "OSU", 8 | "OSU5": "OSU", 9 | "OSU6": "OSU" 10 | }, 11 | "connections": { 12 | "OSU1,O1": "OSU4,I1", 13 | "OSU1,O2": "OSU3,I1", 14 | "OSU2,O1": "OSU3,I2", 15 | "OSU2,O2": "OSU5,I2", 16 | 17 | "OSU3,O1": "OSU4,I2", 18 | "OSU3,O2": "OSU5,I1", 19 | 20 | "OSU4,O2": "OSU6,I1", 21 | "OSU5,O1": "OSU6,I2" 22 | }, 23 | "ports": { 24 | "I1": "OSU1,I1", 25 | "I2": "OSU1,I2", 26 | "I3": "OSU2,I1", 27 | "I4": "OSU2,I2", 28 | 29 | "O1": "OSU4,O1", 30 | "O2": "OSU6,O1", 31 | "O3": "OSU6,O2", 32 | "O4": "OSU5,O2" 33 | } 34 | }, 35 | "models": { 36 | "OSU": "OSU" 37 | } 38 | } -------------------------------------------------------------------------------- /testcases/Clements_4x4/Clements_4x4_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "mzi1": "mzi_ps", 5 | "mzi2": "mzi_ps", 6 | "mzi3": "mzi_ps", 7 | "mzi4": "mzi_ps", 8 | "mzi5": "mzi_ps", 9 | "mzi6": "mzi_ps" 10 | }, 11 | "connections": { 12 | "mzi1,O1": "mzi4,I1", 13 | "mzi1,O2": "mzi3,I1", 14 | "mzi2,O1": "mzi3,I2", 15 | "mzi2,O2": "mzi5,I2", 16 | 17 | "mzi3,O1": "mzi4,I2", 18 | "mzi3,O2": "mzi5,I1", 19 | 20 | "mzi4,O2": "mzi6,I1", 21 | "mzi5,O1": "mzi6,I2" 22 | }, 23 | "ports": { 24 | "I1": "mzi1,I1", 25 | "I2": "mzi1,I2", 26 | "I3": "mzi2,I1", 27 | "I4": "mzi2,I2", 28 | 29 | "O1": "mzi4,O1", 30 | "O2": "mzi6,O1", 31 | "O3": "mzi6,O2", 32 | "O4": "mzi5,O2" 33 | } 34 | }, 35 | "models": { 36 | "mzi_ps": "mzi_ps" 37 | } 38 | } -------------------------------------------------------------------------------- /testcases/Reck_4x4/Reck_4x4_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "mzi1": "mzi_ps", 5 | "mzi2": "mzi_ps", 6 | "mzi3": "mzi_ps", 7 | "mzi4": "mzi_ps", 8 | "mzi5": "mzi_ps", 9 | "mzi6": "mzi_ps" 10 | }, 11 | "connections": { 12 | "mzi1,O2": "mzi2,I1", 13 | "mzi2,O2": "mzi3,I1", 14 | 15 | "mzi1,O1": "mzi4,I1", 16 | "mzi2,O1": "mzi4,I2", 17 | "mzi3,O1": "mzi5,I2", 18 | 19 | "mzi4,O2": "mzi5,I1", 20 | 21 | "mzi4,O1": "mzi6,I1", 22 | "mzi5,O1": "mzi6,I2" 23 | }, 24 | "ports": { 25 | "I1": "mzi1,I1", 26 | "I2": "mzi1,I2", 27 | "I3": "mzi2,I2", 28 | "I4": "mzi3,I2", 29 | 30 | "O1": "mzi6,O1", 31 | "O2": "mzi6,O2", 32 | "O3": "mzi5,O2", 33 | "O4": "mzi3,O2" 34 | } 35 | }, 36 | "models": { 37 | "mzi_ps": "mzi_ps" 38 | } 39 | } -------------------------------------------------------------------------------- /testcases/WDM_mux/WDM_mux_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "ring1": {"component": "mrr", "settings": {"cwl": 1.543}}, 6 | "ring2": {"component": "mrr", "settings": {"cwl": 1.55}}, 7 | "ring3": {"component": "mrr", "settings": {"cwl": 1.554}}, 8 | "ring4": {"component": "mrr", "settings": {"cwl": 1.556}}, 9 | "waveguide1": "waveguide", 10 | "waveguide2": "waveguide", 11 | "waveguide3": "waveguide" 12 | }, 13 | "connections": { 14 | "ring1,O2": "waveguide1,I1", 15 | "waveguide1,O1": "ring2,O3", 16 | "ring2,O2": "waveguide2,I1", 17 | "waveguide2,O1": "ring3,O3", 18 | "ring3,O2": "waveguide3,I1", 19 | "waveguide3,O1": "ring4,O3" 20 | }, 21 | "ports": { 22 | "I1": "ring1,I1", 23 | "I2": "ring2,I1", 24 | "I3": "ring3,I1", 25 | "I4": "ring4,I1", 26 | "O1": "ring4,O2" 27 | 28 | } 29 | }, 30 | "models": { 31 | "mrr": "mrr", 32 | "waveguide": "straight" 33 | } 34 | } -------------------------------------------------------------------------------- /testcases/OS_2x2/OS_2x2_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": 3 | { 4 | "instances": { 5 | "mmi_lft_1": "mmi", 6 | "mmi_lft_2": "mmi", 7 | "mmi_rgt_1": "mmi", 8 | "mmi_rgt_2": "mmi", 9 | "phase_shifter1": "straight_heat_metal", 10 | "phase_shifter2": "straight_heat_metal", 11 | "phase_shifter3": "straight_heat_metal", 12 | "phase_shifter4": "straight_heat_metal" 13 | }, 14 | "connections": { 15 | "mmi_lft_1,O1": "phase_shifter1,I1", 16 | "phase_shifter1,O1": "mmi_rgt_1,O1", 17 | "mmi_lft_1,O2": "phase_shifter2,I1", 18 | "phase_shifter2,O1": "mmi_rgt_2,O1", 19 | "mmi_lft_2,O1": "phase_shifter3,I1", 20 | "phase_shifter3,O1": "mmi_rgt_1,O2", 21 | "mmi_lft_2,O2": "phase_shifter4,I1", 22 | "phase_shifter4,O1": "mmi_rgt_2,O2" 23 | 24 | }, 25 | "ports": { 26 | "I1": "mmi_lft_1,I1", 27 | "I2": "mmi_lft_2,I1", 28 | "O1": "mmi_rgt_1,I1", 29 | "O2": "mmi_rgt_2,I1" 30 | } 31 | }, 32 | "models": { 33 | "mmi": "mmi1x2", 34 | "straight_heat_metal": "straight_heat_metal" 35 | } 36 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Yuchao Wu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /testcases/Crossbar_4x4/Crossbar_4x4_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "OSU11": "OSU", 5 | "OSU12": "OSU", 6 | "OSU13": "OSU", 7 | "OSU14": "OSU", 8 | 9 | "OSU21": "OSU", 10 | "OSU22": "OSU", 11 | "OSU23": "OSU", 12 | "OSU24": "OSU", 13 | 14 | "OSU31": "OSU", 15 | "OSU32": "OSU", 16 | "OSU33": "OSU", 17 | "OSU34": "OSU", 18 | 19 | "OSU41": "OSU", 20 | "OSU42": "OSU", 21 | "OSU43": "OSU", 22 | "OSU44": "OSU" 23 | }, 24 | "connections": { 25 | "OSU11,O1": "OSU12,I2", 26 | "OSU12,O1": "OSU13,I2", 27 | "OSU13,O1": "OSU14,I2", 28 | 29 | "OSU21,O1": "OSU22,I2", 30 | "OSU22,O1": "OSU23,I2", 31 | "OSU23,O1": "OSU24,I2", 32 | 33 | "OSU31,O1": "OSU32,I2", 34 | "OSU32,O1": "OSU33,I2", 35 | "OSU33,O1": "OSU34,I2", 36 | 37 | "OSU41,O1": "OSU42,I2", 38 | "OSU42,O1": "OSU43,I2", 39 | "OSU43,O1": "OSU44,I2", 40 | 41 | "OSU11,O2": "OSU21,I1", 42 | "OSU21,O2": "OSU31,I1", 43 | "OSU31,O2": "OSU41,I1", 44 | 45 | "OSU12,O2": "OSU22,I1", 46 | "OSU22,O2": "OSU32,I1", 47 | "OSU32,O2": "OSU42,I1", 48 | 49 | "OSU13,O2": "OSU23,I1", 50 | "OSU23,O2": "OSU33,I1", 51 | "OSU33,O2": "OSU43,I1", 52 | 53 | "OSU14,O2": "OSU24,I1", 54 | "OSU24,O2": "OSU34,I1", 55 | "OSU34,O2": "OSU44,I1" 56 | }, 57 | "ports": { 58 | "I1": "OSU11,I2", 59 | "I2": "OSU21,I2", 60 | "I3": "OSU31,I2", 61 | "I4": "OSU41,I2", 62 | 63 | "O1": "OSU41,O2", 64 | "O2": "OSU42,O2", 65 | "O3": "OSU43,O2", 66 | "O4": "OSU44,O2" 67 | } 68 | }, 69 | "models": { 70 | "OSU": "OSU" 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /testcases/Spanke_4x4/Spanke_4x4_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "mmi11l": "mmi", 5 | "mmi12l": "mmi", 6 | "mmi13l": "mmi", 7 | 8 | "mmi21l": "mmi", 9 | "mmi22l": "mmi", 10 | "mmi23l": "mmi", 11 | 12 | "mmi31l": "mmi", 13 | "mmi32l": "mmi", 14 | "mmi33l": "mmi", 15 | 16 | "mmi41l": "mmi", 17 | "mmi42l": "mmi", 18 | "mmi43l": "mmi", 19 | 20 | "mmi11r": "mmi", 21 | "mmi12r": "mmi", 22 | "mmi13r": "mmi", 23 | 24 | "mmi21r": "mmi", 25 | "mmi22r": "mmi", 26 | "mmi23r": "mmi", 27 | 28 | "mmi31r": "mmi", 29 | "mmi32r": "mmi", 30 | "mmi33r": "mmi", 31 | 32 | "mmi41r": "mmi", 33 | "mmi42r": "mmi", 34 | "mmi43r": "mmi" 35 | }, 36 | "connections": { 37 | "mmi11l,O1": "mmi12l,I1", 38 | "mmi11l,O2": "mmi13l,I1", 39 | "mmi21l,O1": "mmi22l,I1", 40 | "mmi21l,O2": "mmi23l,I1", 41 | "mmi31l,O1": "mmi32l,I1", 42 | "mmi31l,O2": "mmi33l,I1", 43 | "mmi41l,O1": "mmi42l,I1", 44 | "mmi41l,O2": "mmi43l,I1", 45 | 46 | "mmi12r,I1": "mmi11r,O1", 47 | "mmi13r,I1": "mmi11r,O2", 48 | "mmi22r,I1": "mmi21r,O1", 49 | "mmi23r,I1": "mmi21r,O2", 50 | "mmi32r,I1": "mmi31r,O1", 51 | "mmi33r,I1": "mmi31r,O2", 52 | "mmi42r,I1": "mmi41r,O1", 53 | "mmi43r,I1": "mmi41r,O2", 54 | 55 | "mmi12l,O1": "mmi12r,O1", 56 | "mmi12l,O2": "mmi22r,O1", 57 | "mmi22l,O1": "mmi12r,O2", 58 | "mmi22l,O2": "mmi22r,O2", 59 | 60 | "mmi13l,O1": "mmi32r,O1", 61 | "mmi13l,O2": "mmi42r,O1", 62 | "mmi23l,O1": "mmi32r,O2", 63 | "mmi23l,O2": "mmi42r,O2", 64 | 65 | "mmi32l,O1": "mmi13r,O1", 66 | "mmi32l,O2": "mmi23r,O1", 67 | "mmi42l,O1": "mmi13r,O2", 68 | "mmi42l,O2": "mmi23r,O2", 69 | 70 | "mmi33l,O1": "mmi33r,O1", 71 | "mmi33l,O2": "mmi43r,O1", 72 | "mmi43l,O1": "mmi33r,O2", 73 | "mmi43l,O2": "mmi43r,O2" 74 | }, 75 | "ports": { 76 | "I1": "mmi11l,I1", 77 | "I2": "mmi21l,I1", 78 | "I3": "mmi31l,I1", 79 | "I4": "mmi41l,I1", 80 | 81 | "O1": "mmi11r,I1", 82 | "O2": "mmi21r,I1", 83 | "O3": "mmi31r,I1", 84 | "O4": "mmi41r,I1" 85 | } 86 | }, 87 | "models": { 88 | "mmi": "mmi1x2" 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /testcases/Benes_8x8/Benes_8x8_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "OSU1": "osu", 5 | "OSU2": "osu", 6 | "OSU3": "osu", 7 | "OSU4": "osu", 8 | "OSU5": "osu", 9 | "OSU6": "osu", 10 | "OSU7": "osu", 11 | "OSU8": "osu", 12 | "OSU9": "osu", 13 | "OSU10": "osu", 14 | "OSU11": "osu", 15 | "OSU12": "osu", 16 | "OSU13": "osu", 17 | "OSU14": "osu", 18 | "OSU15": "osu", 19 | "OSU16": "osu", 20 | "OSU17": "osu", 21 | "OSU18": "osu", 22 | "OSU19": "osu", 23 | "OSU20": "osu" 24 | }, 25 | "connections": { 26 | "OSU1,O1": "OSU5,I1", 27 | "OSU1,O2": "OSU7,I1", 28 | "OSU2,O1": "OSU5,I2", 29 | "OSU2,O2": "OSU7,I2", 30 | "OSU3,O1": "OSU6,I1", 31 | "OSU3,O2": "OSU8,I1", 32 | "OSU4,O1": "OSU6,I2", 33 | "OSU4,O2": "OSU8,I2", 34 | 35 | "OSU5,O1": "OSU9,I1", 36 | "OSU5,O2": "OSU10,I1", 37 | "OSU6,O1": "OSU9,I2", 38 | "OSU6,O2": "OSU10,I2", 39 | "OSU7,O1": "OSU11,I1", 40 | "OSU7,O2": "OSU12,I1", 41 | "OSU8,O1": "OSU11,I2", 42 | "OSU8,O2": "OSU12,I2", 43 | 44 | "OSU9,O1": "OSU13,I1", 45 | "OSU9,O2": "OSU14,I1", 46 | "OSU10,O1": "OSU13,I2", 47 | "OSU10,O2": "OSU14,I2", 48 | "OSU11,O1": "OSU15,I1", 49 | "OSU11,O2": "OSU16,I1", 50 | "OSU12,O1": "OSU15,I2", 51 | "OSU12,O2": "OSU16,I2", 52 | 53 | "OSU13,O1": "OSU17,I1", 54 | "OSU15,O1": "OSU17,I2", 55 | "OSU13,O2": "OSU18,I1", 56 | "OSU15,O2": "OSU18,I2", 57 | "OSU14,O1": "OSU19,I1", 58 | "OSU16,O1": "OSU19,I2", 59 | "OSU14,O2": "OSU20,I1", 60 | "OSU16,O2": "OSU20,I2" 61 | }, 62 | "ports": { 63 | "I1": "OSU1,I1", 64 | "I2": "OSU1,I2", 65 | "I3": "OSU2,I1", 66 | "I4": "OSU2,I2", 67 | "I5": "OSU3,I1", 68 | "I6": "OSU3,I2", 69 | "I7": "OSU4,I1", 70 | "I8": "OSU4,I2", 71 | 72 | "O1": "OSU17,O1", 73 | "O2": "OSU17,O2", 74 | "O3": "OSU18,O1", 75 | "O4": "OSU18,O2", 76 | "O5": "OSU19,O1", 77 | "O6": "OSU19,O2", 78 | "O7": "OSU20,O1", 79 | "O8": "OSU20,O2" 80 | } 81 | }, 82 | "models": { 83 | "osu": "OSU" 84 | } 85 | } -------------------------------------------------------------------------------- /PICBench/restrictions.txt: -------------------------------------------------------------------------------- 1 | And Here are some restrictions: 2 | 3 | 1. Each port can only be connected once; duplicate connections to the same port are prohibited. 4 | 2. Connect the ports hierarchically, from the input port stage to the output port stage. 5 | 3. Use "I1", "I2", etc., to name input ports, and "O1", "O2", etc., to name output ports. 6 | 4. Underscores are prohibited in component names. 7 | 5. Only the corresponding json content is required in the result, and notations like ```json``` is prohibited 8 | 6. No comments are allowed in the JSON content. 9 | 10 | 7. Ensure all "connections" and "ports" are valid and consistent with the defined "instances" and "models". Do not generate invalid or undefined mappings. 11 | 8. In the connections section, only component-specific ports should be used. For example, connections should follow the format mzi1, O1: mzi2, I1, where mzi1, O1 is a port on component mzi1, and mzi2, I1 is a port on component mzi2. 12 | -General I/O ports, such as I1, O1, I2, O2, should never appear in the connections section. 13 | -The format for all connections must strictly follow: "component_name, port_name": "component_name, port_name". This ensures that only specific ports are used for connecting components. 14 | 9. Final input ports, such as I1 or I2, or output ports, such as O1 or O2, represent the startpoints/endpoints of the system and should not be part of any connections: 15 | -These ports should only be defined in the ports section to mark the system's boundaries, indicating where the network terminates. 16 | -Final input/output ports should never be involved in internal connections between components. 17 | Important: Only input/output ports defined in the ports section serve as the boundary, and they do not participate in the component-to-component network connections.14. If a specific mapping or port is not explicitly required by the context, omit it rather than assuming arbitrary port names. 18 | 19 | 10. If a specific mapping or port is not explicitly required by the context, omit it rather than assuming arbitrary port names. 20 | 11. Only mmi1x2 is provided, and mmi2x1 can be achieved by rotating mmi1x2. When rotating a built-in mmi1x2 (splitter with one input I1 and two outputs O1, O2) to a mmi2x1 configuration (combiner), the port mapping must be updated: the original outputs become inputs, and the original input becomes the output : two inputs: O1, O2 and one output:I1. 21 | 12. When specified the extra built-in components, the model reference in the 'models' section must be the specified components. 22 | - For example, when specified a component called 'mzi_ps', 'models' section should be like '... : "mzi_ps"' rather than ' "mzi_ps" : ...'. 23 | -------------------------------------------------------------------------------- /PICBench/system_prompt.txt: -------------------------------------------------------------------------------- 1 | You are a professional Photonic Integrated Circuit (PIC) designer. Your task is to generate a JSON netlist based on the user's design requirements. This netlist should specify input/output ports, the necessary components, their configurations, and detailed connections between them. You only complete chats with syntax correct JSON code and the format is as follows: 2 | <<>> 3 | { 4 | "netlist":{ 5 | "instances": { 6 | "": "", 7 | "": {'component': '', 'settings': {'': }} 8 | ... 9 | }, 10 | "connections": { 11 | ",": ",", 12 | ... 13 | }, 14 | "ports": { 15 | "": ",", 16 | ... 17 | } 18 | }, 19 | "models":{ 20 | "": "", 21 | ... 22 | } 23 | } 24 | 25 | Note that: 26 | 1. Your answers should be professional and logical. 27 | 2. The analyses should be as detailed as possible. For example, you can think it step by step. 28 | 3. The response must consist of two sections: 29 | - analysis: A detailed explanation of how the netlist was generated. Start by . 30 | - result: The generated netlist JSON content. Start by . Only the JSON content is required in the result. 31 | 4. Never specify extra parameters unless explicitly stated in the instructions; always use default values. If a difference between two parameters is specified, use the default value for one and adjust the other by the specified difference. 32 | 5. The default unit is micron. 33 | 6. Unless otherwise specified, use built-in components to implement whenever possible. Never specify extra parameters if the instruction do not specify, always use the default value. 34 | 35 | You have access to the following built-in devices, only these devices are permitted unless otherwise specified: 36 | <<>> 37 | mzi: 38 | description: Mach-Zehnder interferometer with one input and one output 39 | input ports: I1 output ports: O1 40 | parameters:delta length.. 41 | mzi_2x2: 42 | description: Mach-Zehnder interferometer with 2 inputs and 2 outputs 43 | input ports: I1,I2 output ports: O1,O2 44 | parameters:delta length.. 45 | coupler: 46 | input ports: I1,I2 output ports: O1,O2 47 | mmi1x2: 48 | input ports: I1 output ports: O1,O2 49 | straight: 50 | description: straight waveguide 51 | input ports: I1 output port: O1 52 | default length:10 53 | parameters:length, phase. 54 | straight_heat_metal: 55 | description: phase shifter 56 | input ports: I1 output port: O1 57 | default length:10 58 | mrr: 59 | description: add-drop microring resonator 60 | input ports: I1 output ports: O1,O2,O3 61 | parameters: cwl(Resonance wavelength).. -------------------------------------------------------------------------------- /testcases/Spanke–Benes_8x8/Spanke–Benes_8x8_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "OSU1": "OSU", 5 | "OSU2": "OSU", 6 | "OSU3": "OSU", 7 | "OSU4": "OSU", 8 | 9 | "OSU5": "OSU", 10 | "OSU6": "OSU", 11 | "OSU7": "OSU", 12 | 13 | "OSU8": "OSU", 14 | "OSU9": "OSU", 15 | "OSU10": "OSU", 16 | "OSU11": "OSU", 17 | 18 | "OSU12": "OSU", 19 | "OSU13": "OSU", 20 | "OSU14": "OSU", 21 | 22 | "OSU15": "OSU", 23 | "OSU16": "OSU", 24 | "OSU17": "OSU", 25 | "OSU18": "OSU", 26 | 27 | "OSU19": "OSU", 28 | "OSU20": "OSU", 29 | "OSU21": "OSU", 30 | 31 | "OSU22": "OSU", 32 | "OSU23": "OSU", 33 | "OSU24": "OSU", 34 | "OSU25": "OSU", 35 | 36 | "OSU26": "OSU", 37 | "OSU27": "OSU", 38 | "OSU28": "OSU" 39 | }, 40 | "connections": { 41 | "OSU1,O1": "OSU8,I1", 42 | "OSU1,O2": "OSU5,I1", 43 | "OSU2,O1": "OSU5,I2", 44 | "OSU2,O2": "OSU6,I2", 45 | "OSU3,O1": "OSU6,I2", 46 | "OSU3,O2": "OSU7,I1", 47 | "OSU4,O1": "OSU7,I2", 48 | "OSU4,O2": "OSU11,I2", 49 | 50 | "OSU5,O1": "OSU8,I2", 51 | "OSU5,O2": "OSU9,I1", 52 | "OSU6,O1": "OSU9,I2", 53 | "OSU6,O2": "OSU10,I2", 54 | "OSU7,O1": "OSU10,I2", 55 | "OSU7,O2": "OSU11,I1", 56 | 57 | "OSU8,O1": "OSU15,I1", 58 | "OSU8,O2": "OSU12,I1", 59 | "OSU9,O1": "OSU12,I2", 60 | "OSU9,O2": "OSU13,I2", 61 | "OSU10,O1": "OSU13,I2", 62 | "OSU10,O2": "OSU14,I1", 63 | "OSU11,O1": "OSU14,I2", 64 | "OSU11,O2": "OSU18,I2", 65 | 66 | "OSU12,O1": "OSU15,I2", 67 | "OSU12,O2": "OSU16,I1", 68 | "OSU13,O1": "OSU16,I2", 69 | "OSU13,O2": "OSU17,I2", 70 | "OSU14,O1": "OSU17,I2", 71 | "OSU14,O2": "OSU18,I1", 72 | 73 | "OSU15,O1": "OSU22,I1", 74 | "OSU15,O2": "OSU19,I1", 75 | "OSU16,O1": "OSU19,I2", 76 | "OSU16,O2": "OSU20,I2", 77 | "OSU17,O1": "OSU20,I2", 78 | "OSU17,O2": "OSU21,I1", 79 | "OSU18,O1": "OSU21,I2", 80 | "OSU18,O2": "OSU25,I2", 81 | 82 | "OSU19,O1": "OSU22,I2", 83 | "OSU19,O2": "OSU23,I1", 84 | "OSU20,O1": "OSU23,I2", 85 | "OSU20,O2": "OSU24,I2", 86 | "OSU21,O1": "OSU24,I2", 87 | "OSU21,O2": "OSU25,I1", 88 | 89 | "OSU22,O2": "OSU26,I1", 90 | "OSU23,O1": "OSU26,I2", 91 | "OSU23,O2": "OSU27,I2", 92 | "OSU24,O1": "OSU27,I2", 93 | "OSU24,O2": "OSU28,I1", 94 | "OSU25,O1": "OSU28,I2" 95 | }, 96 | "ports": { 97 | "I1": "OSU1,I1", 98 | "I2": "OSU1,I2", 99 | "I3": "OSU2,I1", 100 | "I4": "OSU2,I2", 101 | "I5": "OSU3,I1", 102 | "I6": "OSU3,I2", 103 | "I7": "OSU4,I1", 104 | "I8": "OSU4,I2", 105 | "O1": "OSU22,O1", 106 | "O2": "OSU26,O1", 107 | "O3": "OSU26,O2", 108 | "O4": "OSU27,O1", 109 | "O5": "OSU27,O2", 110 | "O6": "OSU28,O1", 111 | "O7": "OSU28,O2", 112 | "O8": "OSU25,O2" 113 | } 114 | }, 115 | "models": { 116 | "OSU": "OSU" 117 | } 118 | } -------------------------------------------------------------------------------- /testcases/Clements_8x8/Clements_8x8_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "mzi1": "mzi_ps", 5 | "mzi2": "mzi_ps", 6 | "mzi3": "mzi_ps", 7 | "mzi4": "mzi_ps", 8 | 9 | "mzi5": "mzi_ps", 10 | "mzi6": "mzi_ps", 11 | "mzi7": "mzi_ps", 12 | 13 | "mzi8": "mzi_ps", 14 | "mzi9": "mzi_ps", 15 | "mzi10": "mzi_ps", 16 | "mzi11": "mzi_ps", 17 | 18 | "mzi12": "mzi_ps", 19 | "mzi13": "mzi_ps", 20 | "mzi14": "mzi_ps", 21 | 22 | "mzi15": "mzi_ps", 23 | "mzi16": "mzi_ps", 24 | "mzi17": "mzi_ps", 25 | "mzi18": "mzi_ps", 26 | 27 | "mzi19": "mzi_ps", 28 | "mzi20": "mzi_ps", 29 | "mzi21": "mzi_ps", 30 | 31 | "mzi22": "mzi_ps", 32 | "mzi23": "mzi_ps", 33 | "mzi24": "mzi_ps", 34 | "mzi25": "mzi_ps", 35 | 36 | "mzi26": "mzi_ps", 37 | "mzi27": "mzi_ps", 38 | "mzi28": "mzi_ps" 39 | }, 40 | "connections": { 41 | "mzi1,O1": "mzi8,I1", 42 | "mzi1,O2": "mzi5,I1", 43 | "mzi2,O1": "mzi5,I2", 44 | "mzi2,O2": "mzi6,I2", 45 | "mzi3,O1": "mzi6,I2", 46 | "mzi3,O2": "mzi7,I1", 47 | "mzi4,O1": "mzi7,I2", 48 | "mzi4,O2": "mzi11,I2", 49 | 50 | "mzi5,O1": "mzi8,I2", 51 | "mzi5,O2": "mzi9,I1", 52 | "mzi6,O1": "mzi9,I2", 53 | "mzi6,O2": "mzi10,I2", 54 | "mzi7,O1": "mzi10,I2", 55 | "mzi7,O2": "mzi11,I1", 56 | 57 | "mzi8,O1": "mzi15,I1", 58 | "mzi8,O2": "mzi12,I1", 59 | "mzi9,O1": "mzi12,I2", 60 | "mzi9,O2": "mzi13,I2", 61 | "mzi10,O1": "mzi13,I2", 62 | "mzi10,O2": "mzi14,I1", 63 | "mzi11,O1": "mzi14,I2", 64 | "mzi11,O2": "mzi18,I2", 65 | 66 | "mzi12,O1": "mzi15,I2", 67 | "mzi12,O2": "mzi16,I1", 68 | "mzi13,O1": "mzi16,I2", 69 | "mzi13,O2": "mzi17,I2", 70 | "mzi14,O1": "mzi17,I2", 71 | "mzi14,O2": "mzi18,I1", 72 | 73 | "mzi15,O1": "mzi22,I1", 74 | "mzi15,O2": "mzi19,I1", 75 | "mzi16,O1": "mzi19,I2", 76 | "mzi16,O2": "mzi20,I2", 77 | "mzi17,O1": "mzi20,I2", 78 | "mzi17,O2": "mzi21,I1", 79 | "mzi18,O1": "mzi21,I2", 80 | "mzi18,O2": "mzi25,I2", 81 | 82 | "mzi19,O1": "mzi22,I2", 83 | "mzi19,O2": "mzi23,I1", 84 | "mzi20,O1": "mzi23,I2", 85 | "mzi20,O2": "mzi24,I2", 86 | "mzi21,O1": "mzi24,I2", 87 | "mzi21,O2": "mzi25,I1", 88 | 89 | "mzi22,O2": "mzi26,I1", 90 | "mzi23,O1": "mzi26,I2", 91 | "mzi23,O2": "mzi27,I2", 92 | "mzi24,O1": "mzi27,I2", 93 | "mzi24,O2": "mzi28,I1", 94 | "mzi25,O1": "mzi28,I2" 95 | }, 96 | "ports": { 97 | "I1": "mzi1,I1", 98 | "I2": "mzi1,I2", 99 | "I3": "mzi2,I1", 100 | "I4": "mzi2,I2", 101 | "I5": "mzi3,I1", 102 | "I6": "mzi3,I2", 103 | "I7": "mzi4,I1", 104 | "I8": "mzi4,I2", 105 | "O1": "mzi22,O1", 106 | "O2": "mzi26,O1", 107 | "O3": "mzi26,O2", 108 | "O4": "mzi27,O1", 109 | "O5": "mzi27,O2", 110 | "O6": "mzi28,O1", 111 | "O7": "mzi28,O2", 112 | "O8": "mzi25,O2" 113 | } 114 | }, 115 | "models": { 116 | "mzi_ps": "mzi_ps" 117 | } 118 | } -------------------------------------------------------------------------------- /testcases/Reck_8x8/Reck_8x8_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "mzi1": "mzi_ps", 5 | "mzi2": "mzi_ps", 6 | "mzi3": "mzi_ps", 7 | "mzi4": "mzi_ps", 8 | "mzi5": "mzi_ps", 9 | "mzi6": "mzi_ps", 10 | "mzi7": "mzi_ps", 11 | 12 | "mzi8": "mzi_ps", 13 | "mzi9": "mzi_ps", 14 | "mzi10": "mzi_ps", 15 | "mzi11": "mzi_ps", 16 | "mzi12": "mzi_ps", 17 | "mzi13": "mzi_ps", 18 | 19 | "mzi14": "mzi_ps", 20 | "mzi15": "mzi_ps", 21 | "mzi16": "mzi_ps", 22 | "mzi17": "mzi_ps", 23 | "mzi18": "mzi_ps", 24 | 25 | "mzi19": "mzi_ps", 26 | "mzi20": "mzi_ps", 27 | "mzi21": "mzi_ps", 28 | "mzi22": "mzi_ps", 29 | 30 | "mzi23": "mzi_ps", 31 | "mzi24": "mzi_ps", 32 | "mzi25": "mzi_ps", 33 | 34 | "mzi26": "mzi_ps", 35 | "mzi27": "mzi_ps", 36 | 37 | "mzi28": "mzi_ps" 38 | }, 39 | "connections": { 40 | "mzi1,O2": "mzi2,I1", 41 | "mzi2,O2": "mzi3,I1", 42 | "mzi3,O2": "mzi4,I1", 43 | "mzi4,O2": "mzi5,I1", 44 | "mzi5,O2": "mzi6,I1", 45 | "mzi6,O2": "mzi7,I1", 46 | 47 | "mzi1,O1": "mzi8,I1", 48 | "mzi2,O1": "mzi8,I2", 49 | "mzi3,O1": "mzi9,I2", 50 | "mzi4,O1": "mzi10,I2", 51 | "mzi5,O1": "mzi11,I2", 52 | "mzi6,O1": "mzi12,I2", 53 | "mzi7,O1": "mzi13,I2", 54 | 55 | "mzi8,O2": "mzi9,I1", 56 | "mzi9,O2": "mzi10,I1", 57 | "mzi10,O2": "mzi11,I1", 58 | "mzi11,O2": "mzi12,I1", 59 | "mzi12,O2": "mzi13,I1", 60 | 61 | "mzi8,O1": "mzi14,I1", 62 | "mzi9,O1": "mzi14,I2", 63 | "mzi10,O1": "mzi15,I2", 64 | "mzi11,O1": "mzi16,I2", 65 | "mzi12,O1": "mzi17,I2", 66 | "mzi13,O1": "mzi18,I2", 67 | 68 | "mzi14,O2": "mzi15,I1", 69 | "mzi15,O2": "mzi16,I1", 70 | "mzi16,O2": "mzi17,I1", 71 | "mzi17,O2": "mzi18,I1", 72 | 73 | "mzi14,O1": "mzi19,I1", 74 | "mzi15,O1": "mzi19,I2", 75 | "mzi16,O1": "mzi20,I2", 76 | "mzi17,O1": "mzi21,I2", 77 | "mzi18,O1": "mzi22,I2", 78 | 79 | "mzi19,O2": "mzi20,I1", 80 | "mzi20,O2": "mzi21,I1", 81 | "mzi21,O2": "mzi22,I1", 82 | 83 | "mzi19,O1": "mzi23,I1", 84 | "mzi20,O1": "mzi23,I2", 85 | "mzi21,O1": "mzi24,I2", 86 | "mzi22,O1": "mzi25,I2", 87 | 88 | "mzi23,O2": "mzi24,I1", 89 | "mzi24,O2": "mzi25,I1", 90 | 91 | "mzi23,O1": "mzi26,I1", 92 | "mzi24,O1": "mzi26,I2", 93 | "mzi25,O1": "mzi27,I2", 94 | 95 | "mzi26,O2": "mzi27,I1", 96 | 97 | "mzi26,O1": "mzi28,I1", 98 | "mzi27,O2": "mzi28,I1" 99 | }, 100 | "ports": { 101 | "I1": "mzi1,I1", 102 | "I2": "mzi1,I2", 103 | "I3": "mzi2,I2", 104 | "I4": "mzi3,I2", 105 | "I5": "mzi4,I2", 106 | "I6": "mzi5,I2", 107 | "I7": "mzi6,I2", 108 | "I8": "mzi7,I2", 109 | 110 | "O1": "mzi7,O2", 111 | "O2": "mzi13,O2", 112 | "O3": "mzi18,O2", 113 | "O4": "mzi22,O2", 114 | "O5": "mzi25,O2", 115 | "O6": "mzi27,O2", 116 | "O7": "mzi28,O1", 117 | "O8": "mzi28,O2" 118 | } 119 | }, 120 | "models": { 121 | "mzi_ps": "mzi_ps" 122 | } 123 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PICBench: Benchmarking LLMs for Photonic Integrated Circuits Design 2 | 3 | ## project composition 4 | 5 | ### **Testbench** 6 | A collection of 24 meticulously crafted design problems. Each design is organized into a folder containing: 7 | - **Description.txt**: A natural language description of the design, including required configurations and the number of input and output ports. 8 | - **netlist.json**: The golden reference design. 9 | - **Frequency_response.json**: The corresponding frequency response of `netlist.json`, generated using the SAX simulator. 10 | 11 | ### **PICBench Core Modules** 12 | - **Restrictions**: Manually summarized restrictions to improve LLM-generated designs. 13 | - **System_prompt**: The system prompt used for all models. 14 | - **Devices**: Parametrized models for components required in the design process. 15 | - **Agent**: Code to interface with the LLM API. 16 | - **Evaluation**: Evaluation using SAX. 17 | - **gen_data**: The main function for automating code generation and evaluation, providing Pass@k metrics. 18 | 19 | ## **Setup** 20 | To use **PICBench**, ensure you have the following: 21 | 1. Python version **>= 3.10**. 22 | 2. Install [SAX](https://github.com/flaport/sax) for circuit simulation: 23 | ```bash 24 | pip install sax jax openai anthropic google-generativeai 25 | ``` 26 | **Note**: Older or newer versions of these packages may not be compatible with PICBench. If you encounter issues, use the tested versions below: 27 | 28 | ```bash 29 | pip install sax==0.13.3 jax==0.4.34 openai==1.43.0 anthropic==0.43.0 google-generativeai==0.8.3 30 | ``` 31 | 32 | ## **Usage** 33 | You can run the PICBench via command line: 34 | 35 | ```bash 36 | python gen_data.py \ 37 | --path "" \ 38 | --restriction_label \ 39 | --max_iterations \ 40 | --pass_k \ 41 | --total_samples \ 42 | --model "" \ 43 | --api_key "" 44 | ``` 45 | 46 | You can also use the tool programmatically: 47 | 48 | ```bash 49 | from gen_data import PICBench 50 | 51 | PICBench( 52 | path="../testcases", 53 | restriction_label=True, 54 | max_iterations=3, 55 | pass_k=1, 56 | total_samples=5, 57 | model="gpt-4", 58 | api_key="your-api-key" 59 | ) 60 | ``` 61 | 62 | ### **Parameters** 63 | | Parameter | Type | Default | Description | 64 | |-----------------------|---------|-------------------------------|----------------------------------------------------------------------------| 65 | | `--path` | string | '../testcases' | Path to the directory containing test cases and solutions. | 66 | | `--restriction_label` | boolean | 'True' | Whether to apply restrictions to the generation process. | 67 | | `--max_iterations` | int | '3' | Maximum iterations for error feedback. | 68 | | `--pass_k` | int | '1' | k for Pass@k. | 69 | | `--total_samples` | int | '5' | Total number of samples to generate. | 70 | | `--model` | string | '"gpt-4"' | Name of the language model to use for reasoning steps. | 71 | | `--api_key` | string | Required | API key to authenticate with the language model service. | 72 | -------------------------------------------------------------------------------- /PICBench/evaluation.py: -------------------------------------------------------------------------------- 1 | import json 2 | from devices import * 3 | import numpy as np 4 | 5 | 6 | def normalize_array(array, precision=10): 7 | return tuple(np.round(array, precision)) # Round each element to the desired precision 8 | 9 | 10 | def compare_golden(set1, golden): 11 | # Convert each array to a tuple (to preserve order) and then compare as sets 12 | ans = 'functional check passed' 13 | set1_normalized = {normalize_array(array) for array in set1} 14 | set2_normalized = {normalize_array(array) for array in golden} 15 | if set1_normalized != set2_normalized: 16 | ans = 'functional error, The syntax is correct, but a functional error has occurred. Please review the problem description carefully.' 17 | 18 | # Compare the sets of tuples 19 | return ans 20 | 21 | 22 | def evaluate(netlist, design_name): 23 | try: 24 | data = json.loads(netlist) 25 | except Exception as e: 26 | # file start with '''json 27 | if 'Expecting value' in str(e): 28 | return f"other syntax error, Extra contents found in JSON, The file starts with ```json or other notations, which is not part of valid JSON. Remove the prefix and try again. {e}" 29 | elif '//' in netlist: 30 | return f'other syntax error, Extra contents found in JSON, The file contains // for comments, which is not part of valid JSON. Remove the comments and try again. {e}' 31 | elif '...' in netlist: 32 | return f'other syntax error, Please do not omit any code, generate complete code that can be compiled directly. {e}' 33 | elif 'Extra data:' in str(e): 34 | return f"other syntax error, Extra contents found in JSON, The file ends with some other extra contents (like advice/comments/summary), which is not part of valid JSON. Only JSON code is required in the result part. Remove the suffix and try again. {e}" 35 | elif 'Expecting property name' in str(e): 36 | return f'other syntax error, Trailing commas are not allowed in JSON objects or arrays. Please remove the extra comma, {e}' 37 | elif 'does not contain port' in str(e): 38 | return f'wrong ports error, {e}' 39 | elif 'Missing models' in str(e): 40 | return f'Mess up ‘instances’ and ‘models’ part, {e}' 41 | elif 'Value error, Invalid port string' in str(e): 42 | return f'Bind the I/O ports, {e}' 43 | else: 44 | return f'wrong model names, {e}' 45 | try: 46 | model_data = {key: globals()[value] for key, value in data["models"].items()} 47 | except Exception as e: 48 | # wrong model names 49 | return f'wrong model names, {e}' 50 | try: 51 | design, _ = sax.circuit(netlist=data["netlist"], models=model_data) 52 | wl = jnp.linspace(1.51, 1.59, 1000) 53 | S = design(wl=wl) 54 | ports = data["netlist"]["ports"] 55 | inputs = {key: value for key, value in ports.items() if key.startswith('I')} 56 | outputs = {key: value for key, value in ports.items() if key.startswith('O')} 57 | in_port = list(inputs.keys()) 58 | out_port = list(outputs.keys()) 59 | result = [] 60 | for i in in_port: 61 | for o in out_port: 62 | trans = abs(S[i, o]) ** 2 63 | result.append(trans.tolist()) 64 | 65 | # result = set(result) 66 | with open(f"../testcases/{design_name}/{design_name}_res.json", "r") as f: 67 | golden_res = json.load(f) 68 | # get all the values 69 | golden = [value for key, value in golden_res.items()] 70 | # golden = set(golden) 71 | if len(result) != len(golden): 72 | ports = [key for key, value in golden_res.items()] 73 | in_port_set = set() 74 | out_port_set = set() 75 | for i in range(len(ports)): 76 | in_port_set.add(ports[i].split('_')[0]) 77 | out_port_set.add(ports[i].split('_')[1]) 78 | # 'wrong ports number', the number of input should be {len(golden_res)} but got {len(result)} 79 | res = (f'wrong ports number, the number of input should be {len(in_port_set)} got {len(in_port)}, ' 80 | f'the number of output should be {len(out_port_set)} got {len(out_port)}' 81 | f'And note that the input should start with I and the output should start with O') 82 | 83 | else: 84 | # functional check 85 | res = compare_golden(result, golden) 86 | except Exception as e: 87 | # syntax error 88 | res = f'other syntax error, {e}' 89 | return res 90 | -------------------------------------------------------------------------------- /testcases/Crossbar_8x8/Crossbar_8x8_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "OSU11": "OSU", 5 | "OSU12": "OSU", 6 | "OSU13": "OSU", 7 | "OSU14": "OSU", 8 | "OSU15": "OSU", 9 | "OSU16": "OSU", 10 | "OSU17": "OSU", 11 | "OSU18": "OSU", 12 | 13 | "OSU21": "OSU", 14 | "OSU22": "OSU", 15 | "OSU23": "OSU", 16 | "OSU24": "OSU", 17 | "OSU25": "OSU", 18 | "OSU26": "OSU", 19 | "OSU27": "OSU", 20 | "OSU28": "OSU", 21 | 22 | "OSU31": "OSU", 23 | "OSU32": "OSU", 24 | "OSU33": "OSU", 25 | "OSU34": "OSU", 26 | "OSU35": "OSU", 27 | "OSU36": "OSU", 28 | "OSU37": "OSU", 29 | "OSU38": "OSU", 30 | 31 | "OSU41": "OSU", 32 | "OSU42": "OSU", 33 | "OSU43": "OSU", 34 | "OSU44": "OSU", 35 | "OSU45": "OSU", 36 | "OSU46": "OSU", 37 | "OSU47": "OSU", 38 | "OSU48": "OSU", 39 | 40 | "OSU51": "OSU", 41 | "OSU52": "OSU", 42 | "OSU53": "OSU", 43 | "OSU54": "OSU", 44 | "OSU55": "OSU", 45 | "OSU56": "OSU", 46 | "OSU57": "OSU", 47 | "OSU58": "OSU", 48 | 49 | "OSU61": "OSU", 50 | "OSU62": "OSU", 51 | "OSU63": "OSU", 52 | "OSU64": "OSU", 53 | "OSU65": "OSU", 54 | "OSU66": "OSU", 55 | "OSU67": "OSU", 56 | "OSU68": "OSU", 57 | 58 | "OSU71": "OSU", 59 | "OSU72": "OSU", 60 | "OSU73": "OSU", 61 | "OSU74": "OSU", 62 | "OSU75": "OSU", 63 | "OSU76": "OSU", 64 | "OSU77": "OSU", 65 | "OSU78": "OSU", 66 | 67 | "OSU81": "OSU", 68 | "OSU82": "OSU", 69 | "OSU83": "OSU", 70 | "OSU84": "OSU", 71 | "OSU85": "OSU", 72 | "OSU86": "OSU", 73 | "OSU87": "OSU", 74 | "OSU88": "OSU" 75 | }, 76 | "connections": { 77 | "OSU11,O1": "OSU12,I2", 78 | "OSU12,O1": "OSU13,I2", 79 | "OSU13,O1": "OSU14,I2", 80 | "OSU14,O1": "OSU15,I2", 81 | "OSU15,O1": "OSU16,I2", 82 | "OSU16,O1": "OSU17,I2", 83 | "OSU17,O1": "OSU18,I2", 84 | 85 | "OSU21,O1": "OSU22,I2", 86 | "OSU22,O1": "OSU23,I2", 87 | "OSU23,O1": "OSU24,I2", 88 | "OSU24,O1": "OSU25,I2", 89 | "OSU25,O1": "OSU26,I2", 90 | "OSU26,O1": "OSU27,I2", 91 | "OSU27,O1": "OSU28,I2", 92 | 93 | "OSU31,O1": "OSU32,I2", 94 | "OSU32,O1": "OSU33,I2", 95 | "OSU33,O1": "OSU34,I2", 96 | "OSU34,O1": "OSU35,I2", 97 | "OSU35,O1": "OSU36,I2", 98 | "OSU36,O1": "OSU37,I2", 99 | "OSU37,O1": "OSU38,I2", 100 | 101 | "OSU41,O1": "OSU42,I2", 102 | "OSU42,O1": "OSU43,I2", 103 | "OSU43,O1": "OSU44,I2", 104 | "OSU44,O1": "OSU45,I2", 105 | "OSU45,O1": "OSU46,I2", 106 | "OSU46,O1": "OSU47,I2", 107 | "OSU47,O1": "OSU48,I2", 108 | 109 | "OSU51,O1": "OSU52,I2", 110 | "OSU52,O1": "OSU53,I2", 111 | "OSU53,O1": "OSU54,I2", 112 | "OSU54,O1": "OSU55,I2", 113 | "OSU55,O1": "OSU56,I2", 114 | "OSU56,O1": "OSU57,I2", 115 | "OSU57,O1": "OSU58,I2", 116 | 117 | "OSU61,O1": "OSU62,I2", 118 | "OSU62,O1": "OSU63,I2", 119 | "OSU63,O1": "OSU64,I2", 120 | "OSU64,O1": "OSU65,I2", 121 | "OSU65,O1": "OSU66,I2", 122 | "OSU66,O1": "OSU67,I2", 123 | "OSU67,O1": "OSU68,I2", 124 | 125 | "OSU71,O1": "OSU72,I2", 126 | "OSU72,O1": "OSU73,I2", 127 | "OSU73,O1": "OSU74,I2", 128 | "OSU74,O1": "OSU75,I2", 129 | "OSU75,O1": "OSU76,I2", 130 | "OSU76,O1": "OSU77,I2", 131 | "OSU77,O1": "OSU78,I2", 132 | 133 | "OSU81,O1": "OSU82,I2", 134 | "OSU82,O1": "OSU83,I2", 135 | "OSU83,O1": "OSU84,I2", 136 | "OSU84,O1": "OSU85,I2", 137 | "OSU85,O1": "OSU86,I2", 138 | "OSU86,O1": "OSU87,I2", 139 | "OSU87,O1": "OSU88,I2", 140 | 141 | "OSU11,O2": "OSU21,I1", 142 | "OSU21,O2": "OSU31,I1", 143 | "OSU31,O2": "OSU41,I1", 144 | "OSU41,O2": "OSU51,I1", 145 | "OSU51,O2": "OSU61,I1", 146 | "OSU61,O2": "OSU71,I1", 147 | "OSU71,O2": "OSU81,I1", 148 | 149 | "OSU12,O2": "OSU22,I1", 150 | "OSU22,O2": "OSU32,I1", 151 | "OSU32,O2": "OSU42,I1", 152 | "OSU42,O2": "OSU52,I1", 153 | "OSU52,O2": "OSU62,I1", 154 | "OSU62,O2": "OSU72,I1", 155 | "OSU72,O2": "OSU82,I1", 156 | 157 | "OSU13,O2": "OSU23,I1", 158 | "OSU23,O2": "OSU33,I1", 159 | "OSU33,O2": "OSU43,I1", 160 | "OSU43,O2": "OSU53,I1", 161 | "OSU53,O2": "OSU63,I1", 162 | "OSU63,O2": "OSU73,I1", 163 | "OSU73,O2": "OSU83,I1", 164 | 165 | "OSU14,O2": "OSU24,I1", 166 | "OSU24,O2": "OSU34,I1", 167 | "OSU34,O2": "OSU44,I1", 168 | "OSU44,O2": "OSU54,I1", 169 | "OSU54,O2": "OSU64,I1", 170 | "OSU64,O2": "OSU74,I1", 171 | "OSU74,O2": "OSU84,I1", 172 | 173 | "OSU15,O2": "OSU25,I1", 174 | "OSU25,O2": "OSU35,I1", 175 | "OSU35,O2": "OSU45,I1", 176 | "OSU45,O2": "OSU55,I1", 177 | "OSU55,O2": "OSU65,I1", 178 | "OSU65,O2": "OSU75,I1", 179 | "OSU75,O2": "OSU85,I1", 180 | 181 | "OSU16,O2": "OSU26,I1", 182 | "OSU26,O2": "OSU36,I1", 183 | "OSU36,O2": "OSU46,I1", 184 | "OSU46,O2": "OSU56,I1", 185 | "OSU56,O2": "OSU66,I1", 186 | "OSU66,O2": "OSU76,I1", 187 | "OSU76,O2": "OSU86,I1", 188 | 189 | "OSU17,O2": "OSU27,I1", 190 | "OSU27,O2": "OSU37,I1", 191 | "OSU37,O2": "OSU47,I1", 192 | "OSU47,O2": "OSU57,I1", 193 | "OSU57,O2": "OSU67,I1", 194 | "OSU67,O2": "OSU77,I1", 195 | "OSU77,O2": "OSU87,I1", 196 | 197 | "OSU18,O2": "OSU28,I1", 198 | "OSU28,O2": "OSU38,I1", 199 | "OSU38,O2": "OSU48,I1", 200 | "OSU48,O2": "OSU58,I1", 201 | "OSU58,O2": "OSU68,I1", 202 | "OSU68,O2": "OSU78,I1", 203 | "OSU78,O2": "OSU88,I1" 204 | }, 205 | "ports": { 206 | "I1": "OSU11,I2", 207 | "I2": "OSU21,I2", 208 | "I3": "OSU31,I2", 209 | "I4": "OSU41,I2", 210 | "I5": "OSU51,I2", 211 | "I6": "OSU61,I2", 212 | "I7": "OSU71,I2", 213 | "I8": "OSU81,I2", 214 | 215 | "O1": "OSU81,O2", 216 | "O2": "OSU82,O2", 217 | "O3": "OSU83,O2", 218 | "O4": "OSU84,O2", 219 | "O5": "OSU85,O2", 220 | "O6": "OSU86,O2", 221 | "O7": "OSU87,O2", 222 | "O8": "OSU88,O2" 223 | } 224 | }, 225 | "models": { 226 | "OSU": "OSU" 227 | } 228 | } 229 | -------------------------------------------------------------------------------- /PICBench/devices.py: -------------------------------------------------------------------------------- 1 | import jax 2 | import jax.example_libraries.optimizers as opt 3 | import json 4 | import jax.numpy as jnp 5 | import matplotlib.pyplot as plt # plotting 6 | import sax 7 | from tqdm.notebook import trange 8 | 9 | 10 | def straight(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0) -> sax.SDict: 11 | dwl = wl - wl0 12 | dneff_dwl = (ng - neff) / wl0 13 | neff = neff - dwl * dneff_dwl 14 | phase = 2 * jnp.pi * neff * length / wl 15 | transmission = 10 ** (-loss * length / 20) * jnp.exp(1j * phase) 16 | sdict = sax.reciprocal( 17 | { 18 | ("I1", "O1"): transmission, 19 | } 20 | ) 21 | return sdict 22 | 23 | 24 | def coupler_single(coupling=0.5) -> sax.SDict: 25 | kappa = coupling ** 0.5 26 | tau = (1 - coupling) ** 0.5 27 | coupler_dict = sax.reciprocal( 28 | { 29 | ("I1", "O1"): tau, 30 | ("I1", "O2"): 1j * kappa, 31 | ("I2", "O1"): 1j * kappa, 32 | ("I2", "O2"): tau, 33 | } 34 | ) 35 | return coupler_dict 36 | 37 | 38 | def mmi1x2_single(coupling=0.5) -> sax.SDict: 39 | kappa = coupling ** 0.5 40 | tau = (1 - coupling) ** 0.5 41 | mmi_dict = sax.reciprocal( 42 | { 43 | ("I1", "O1"): kappa, 44 | ("I1", "O2"): tau, 45 | } 46 | ) 47 | return mmi_dict 48 | 49 | 50 | def straight_heat_metal(wl=1.55, wl0=1.55, neff=2.34, ng=3.4, length=10.0, loss=0.0, phase_shift=90) -> sax.SDict: 51 | phase_shift_rad = phase_shift * jnp.pi / 180 52 | dwl = wl - wl0 53 | dneff_dwl = (ng - neff) / wl0 54 | neff = neff - dwl * dneff_dwl 55 | phase = 2 * jnp.pi * neff * length / wl + phase_shift_rad 56 | transmission = 10 ** (-loss * length / 20) * jnp.exp(1j * phase) 57 | sdict = sax.reciprocal( 58 | { 59 | ("I1", "O1"): transmission, 60 | } 61 | ) 62 | return sdict 63 | 64 | 65 | mmi1x2, _ = sax.circuit( 66 | netlist={ 67 | "instances": { 68 | 'mmi': 'mmi', 69 | "waveguide1": {'component': 'waveguide', 'settings': {'length': 0.0}}, 70 | "waveguide2": {'component': 'waveguide', 'settings': {'length': 0.0}}, 71 | }, 72 | "connections": { 73 | "mmi,O1": "waveguide1,I1", 74 | "mmi,O2": "waveguide2,I1", 75 | }, 76 | "ports": { 77 | "I1": "mmi,I1", 78 | "O1": "waveguide1,O1", 79 | "O2": "waveguide2,O1", 80 | }, 81 | }, 82 | models={ 83 | "mmi": mmi1x2_single, 84 | "waveguide": straight, 85 | }, 86 | ) 87 | 88 | coupler, _ = sax.circuit( 89 | netlist={ 90 | "instances": { 91 | 'coupler': 'coupler', 92 | "waveguide1": {'component': 'waveguide', 'settings': {'length': 0.0}}, 93 | "waveguide2": {'component': 'waveguide', 'settings': {'length': 0.0}}, 94 | }, 95 | "connections": { 96 | "coupler,O1": "waveguide1,I1", 97 | "coupler,O2": "waveguide2,I1", 98 | }, 99 | "ports": { 100 | "I1": "coupler,I1", 101 | "I2": "coupler,I2", 102 | "O1": "waveguide1,O1", 103 | "O2": "waveguide2,O1", 104 | }, 105 | }, 106 | models={ 107 | "coupler": coupler_single, 108 | "waveguide": straight, 109 | }, 110 | ) 111 | 112 | 113 | mzi, _ = sax.circuit( 114 | netlist={ 115 | "instances": { 116 | "lft": "mmi", 117 | "top": "waveguide", 118 | "btm": "waveguide", 119 | "rgt": "mmi", 120 | }, 121 | "connections": { 122 | "lft,O1": "top,I1", 123 | "top,O1": "rgt,O1", 124 | "lft,O2": "btm,I1", 125 | "btm,O1": "rgt,O2", 126 | }, 127 | "ports": { 128 | "I1": "lft,I1", 129 | "O1": "rgt,I1", 130 | }, 131 | }, 132 | models={ 133 | "mmi": mmi1x2, 134 | "waveguide": straight, 135 | }, 136 | ) 137 | 138 | mzi_2x2, _ = sax.circuit( 139 | netlist={ 140 | "instances": { 141 | "lft": "coupler", 142 | "top": "waveguide", 143 | "btm": "waveguide", 144 | "rgt": "coupler", 145 | }, 146 | "connections": { 147 | "lft,O1": "top,I1", 148 | "top,O1": "rgt,I1", 149 | "lft,O2": "btm,I1", 150 | "btm,O1": "rgt,I2", 151 | }, 152 | "ports": { 153 | "I1": "lft,I1", 154 | "I2": "lft,I2", 155 | "O1": "rgt,O1", 156 | "O2": "rgt,O2", 157 | }, 158 | }, 159 | models={ 160 | "coupler": coupler, 161 | "waveguide": straight, 162 | }, 163 | ) 164 | 165 | OSU, _ = sax.circuit( 166 | netlist={ 167 | "instances": { 168 | "coupler1": "coupler", 169 | "coupler2": "coupler", 170 | "phase_shifter2": "phase_shifter", 171 | "phase_shifter1": {"component": "phase_shifter", "settings": {"phase_shift": 270}}, 172 | }, 173 | "connections": { 174 | "coupler1, O1": "phase_shifter1,I1", 175 | "phase_shifter1,O1": "coupler2,I1", 176 | "coupler1, O2": "phase_shifter2,I1", 177 | "phase_shifter2,O1": "coupler2,I2", 178 | }, 179 | "ports": { 180 | "I1": "coupler1,I1", 181 | "I2": "coupler1,I2", 182 | "O1": "coupler2,O1", 183 | "O2": "coupler2,O2", 184 | }, 185 | }, 186 | models={ 187 | "coupler": coupler, 188 | "phase_shifter": straight_heat_metal, 189 | }, 190 | ) 191 | 192 | 193 | mzi_ps, _ = sax.circuit( 194 | netlist={ 195 | "instances": { 196 | "coupler1": "coupler", 197 | "coupler2": "coupler", 198 | "ps1": "phase_shifter", 199 | "ps2": "phase_shifter", 200 | "waveguide": "waveguide", 201 | }, 202 | "connections": { 203 | "coupler1,O1": "ps1,I1", 204 | "coupler1,O2": "waveguide,I1", 205 | "ps1,O1": "coupler2,I1", 206 | "waveguide,O1": "coupler2,I2", 207 | "coupler2,O1": "ps2,I1", 208 | }, 209 | "ports": { 210 | "I1": "coupler1,I1", 211 | "I2": "coupler1,I2", 212 | "O1": "ps2,O1", 213 | "O2": "coupler2,O2", 214 | }, 215 | }, 216 | models={ 217 | "coupler": coupler, 218 | "phase_shifter": straight_heat_metal, 219 | "waveguide": straight, 220 | }, 221 | ) 222 | 223 | mzm, _ = sax.circuit( 224 | netlist={ 225 | "instances": { 226 | "splitter": "mmi", 227 | "combiner": "mmi", 228 | "phase_shifter1": "phase_shifter", 229 | "phase_shifter2": "waveguide", 230 | }, 231 | "connections": { 232 | "splitter,O1": "phase_shifter1,I1", 233 | "splitter,O2": "phase_shifter2,I1", 234 | "phase_shifter1,O1": "combiner,O1", 235 | "phase_shifter2,O1": "combiner,O2" 236 | }, 237 | "ports": { 238 | "I1": "splitter,I1", 239 | "O1": "combiner,I1", 240 | }, 241 | }, 242 | models={ 243 | "mmi": mmi1x2, 244 | "phase_shifter": straight_heat_metal, 245 | "waveguide": straight, 246 | }, 247 | ) 248 | 249 | mzm_dual, _ = sax.circuit( 250 | netlist={ 251 | "instances": { 252 | "splitter": "mmi", 253 | "combiner": "mmi", 254 | "phase_shifter1": "phase_shifter", 255 | "phase_shifter2": {"component": "phase_shifter", "settings": {"phase_shift": 0}}, 256 | }, 257 | "connections": { 258 | "splitter,O1": "phase_shifter1,I1", 259 | "splitter,O2": "phase_shifter2,I1", 260 | "phase_shifter1,O1": "combiner,O1", 261 | "phase_shifter2,O1": "combiner,O2", 262 | }, 263 | "ports": { 264 | "I1": "splitter,I1", 265 | "O1": "combiner,I1", 266 | }, 267 | }, 268 | models={ 269 | "mmi": mmi1x2, 270 | "phase_shifter": straight_heat_metal, 271 | }, 272 | ) 273 | 274 | 275 | def mrr(wl=1.55, kappa=0.3, neff=2.34, alpha=0.99, cwl=1.55) -> sax.SDict: 276 | map_dict = {1.543: 9.74, 1.546: 9.78, 1.547: 9.68, 1.55: 9.7, 1.552: 9.5, 1.554: 9.83, 1.556: 9.95} 277 | r = map_dict[cwl] 278 | t = (1 - kappa**2) ** 0.5 279 | beta = neff * (2 * jnp.pi / wl) 280 | theta = 2 * jnp.pi * r * beta 281 | ring_dict = sax.reciprocal( 282 | { 283 | ("I1", "O1"): jnp.abs((t - alpha * jnp.exp(-1j * theta)) / (1 - t * alpha * jnp.exp(-1j * theta))) ** 2, 284 | ("I1", "O2"): jnp.abs((1j * kappa * alpha**2 * jnp.exp(-1j * theta /2)) / (1 - t * alpha * jnp.exp(-1j * theta)))**2, 285 | ("I1", "O3"): 1 - jnp.abs((t - alpha * jnp.exp(-1j * theta)) / (1 - t * alpha * jnp.exp(-1j * theta))) ** 2 - jnp.abs((1j * kappa * alpha**2 * jnp.exp(-1j * theta /2)) / (1 - t * alpha * jnp.exp(-1j * theta)))**2, 286 | } 287 | ) 288 | return ring_dict -------------------------------------------------------------------------------- /testcases/Spanke_8x8/Spanke_8x8_ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "netlist": { 3 | "instances": { 4 | "mmi11l": "mmi", 5 | "mmi12l": "mmi", 6 | "mmi13l": "mmi", 7 | "mmi14l": "mmi", 8 | "mmi15l": "mmi", 9 | "mmi16l": "mmi", 10 | "mmi17l": "mmi", 11 | 12 | "mmi21l": "mmi", 13 | "mmi22l": "mmi", 14 | "mmi23l": "mmi", 15 | "mmi24l": "mmi", 16 | "mmi25l": "mmi", 17 | "mmi26l": "mmi", 18 | "mmi27l": "mmi", 19 | 20 | "mmi31l": "mmi", 21 | "mmi32l": "mmi", 22 | "mmi33l": "mmi", 23 | "mmi34l": "mmi", 24 | "mmi35l": "mmi", 25 | "mmi36l": "mmi", 26 | "mmi37l": "mmi", 27 | 28 | "mmi41l": "mmi", 29 | "mmi42l": "mmi", 30 | "mmi43l": "mmi", 31 | "mmi44l": "mmi", 32 | "mmi45l": "mmi", 33 | "mmi46l": "mmi", 34 | "mmi47l": "mmi", 35 | 36 | "mmi51l": "mmi", 37 | "mmi52l": "mmi", 38 | "mmi53l": "mmi", 39 | "mmi54l": "mmi", 40 | "mmi55l": "mmi", 41 | "mmi56l": "mmi", 42 | "mmi57l": "mmi", 43 | 44 | "mmi61l": "mmi", 45 | "mmi62l": "mmi", 46 | "mmi63l": "mmi", 47 | "mmi64l": "mmi", 48 | "mmi65l": "mmi", 49 | "mmi66l": "mmi", 50 | "mmi67l": "mmi", 51 | 52 | "mmi71l": "mmi", 53 | "mmi72l": "mmi", 54 | "mmi73l": "mmi", 55 | "mmi74l": "mmi", 56 | "mmi75l": "mmi", 57 | "mmi76l": "mmi", 58 | "mmi77l": "mmi", 59 | 60 | "mmi81l": "mmi", 61 | "mmi82l": "mmi", 62 | "mmi83l": "mmi", 63 | "mmi84l": "mmi", 64 | "mmi85l": "mmi", 65 | "mmi86l": "mmi", 66 | "mmi87l": "mmi", 67 | 68 | "mmi11r": "mmi", 69 | "mmi12r": "mmi", 70 | "mmi13r": "mmi", 71 | "mmi14r": "mmi", 72 | "mmi15r": "mmi", 73 | "mmi16r": "mmi", 74 | "mmi17r": "mmi", 75 | 76 | "mmi21r": "mmi", 77 | "mmi22r": "mmi", 78 | "mmi23r": "mmi", 79 | "mmi24r": "mmi", 80 | "mmi25r": "mmi", 81 | "mmi26r": "mmi", 82 | "mmi27r": "mmi", 83 | 84 | "mmi31r": "mmi", 85 | "mmi32r": "mmi", 86 | "mmi33r": "mmi", 87 | "mmi34r": "mmi", 88 | "mmi35r": "mmi", 89 | "mmi36r": "mmi", 90 | "mmi37r": "mmi", 91 | 92 | "mmi41r": "mmi", 93 | "mmi42r": "mmi", 94 | "mmi43r": "mmi", 95 | "mmi44r": "mmi", 96 | "mmi45r": "mmi", 97 | "mmi46r": "mmi", 98 | "mmi47r": "mmi", 99 | 100 | "mmi51r": "mmi", 101 | "mmi52r": "mmi", 102 | "mmi53r": "mmi", 103 | "mmi54r": "mmi", 104 | "mmi55r": "mmi", 105 | "mmi56r": "mmi", 106 | "mmi57r": "mmi", 107 | 108 | "mmi61r": "mmi", 109 | "mmi62r": "mmi", 110 | "mmi63r": "mmi", 111 | "mmi64r": "mmi", 112 | "mmi65r": "mmi", 113 | "mmi66r": "mmi", 114 | "mmi67r": "mmi", 115 | 116 | "mmi71r": "mmi", 117 | "mmi72r": "mmi", 118 | "mmi73r": "mmi", 119 | "mmi74r": "mmi", 120 | "mmi75r": "mmi", 121 | "mmi76r": "mmi", 122 | "mmi77r": "mmi", 123 | 124 | "mmi81r": "mmi", 125 | "mmi82r": "mmi", 126 | "mmi83r": "mmi", 127 | "mmi84r": "mmi", 128 | "mmi85r": "mmi", 129 | "mmi86r": "mmi", 130 | "mmi87r": "mmi" 131 | }, 132 | "connections": { 133 | "mmi11l,O1": "mmi12l,I1", 134 | "mmi11l,O2": "mmi13l,I1", 135 | "mmi12l,O1": "mmi14l,I1", 136 | "mmi12l,O2": "mmi15l,I1", 137 | "mmi13l,O1": "mmi16l,I1", 138 | "mmi13l,O2": "mmi17l,I1", 139 | "mmi21l,O1": "mmi22l,I1", 140 | "mmi21l,O2": "mmi23l,I1", 141 | "mmi22l,O1": "mmi24l,I1", 142 | "mmi22l,O2": "mmi25l,I1", 143 | "mmi23l,O1": "mmi26l,I1", 144 | "mmi23l,O2": "mmi27l,I1", 145 | "mmi31l,O1": "mmi32l,I1", 146 | "mmi31l,O2": "mmi33l,I1", 147 | "mmi32l,O1": "mmi34l,I1", 148 | "mmi32l,O2": "mmi35l,I1", 149 | "mmi33l,O1": "mmi36l,I1", 150 | "mmi33l,O2": "mmi37l,I1", 151 | "mmi41l,O1": "mmi42l,I1", 152 | "mmi41l,O2": "mmi43l,I1", 153 | "mmi42l,O1": "mmi44l,I1", 154 | "mmi42l,O2": "mmi45l,I1", 155 | "mmi43l,O1": "mmi46l,I1", 156 | "mmi43l,O2": "mmi47l,I1", 157 | "mmi51l,O1": "mmi52l,I1", 158 | "mmi51l,O2": "mmi53l,I1", 159 | "mmi52l,O1": "mmi54l,I1", 160 | "mmi52l,O2": "mmi55l,I1", 161 | "mmi53l,O1": "mmi56l,I1", 162 | "mmi53l,O2": "mmi57l,I1", 163 | "mmi61l,O1": "mmi62l,I1", 164 | "mmi61l,O2": "mmi63l,I1", 165 | "mmi62l,O1": "mmi64l,I1", 166 | "mmi62l,O2": "mmi65l,I1", 167 | "mmi63l,O1": "mmi66l,I1", 168 | "mmi63l,O2": "mmi67l,I1", 169 | "mmi71l,O1": "mmi72l,I1", 170 | "mmi71l,O2": "mmi73l,I1", 171 | "mmi72l,O1": "mmi74l,I1", 172 | "mmi72l,O2": "mmi75l,I1", 173 | "mmi73l,O1": "mmi76l,I1", 174 | "mmi73l,O2": "mmi77l,I1", 175 | "mmi81l,O1": "mmi82l,I1", 176 | "mmi81l,O2": "mmi83l,I1", 177 | "mmi82l,O1": "mmi84l,I1", 178 | "mmi82l,O2": "mmi85l,I1", 179 | "mmi83l,O1": "mmi86l,I1", 180 | "mmi83l,O2": "mmi87l,I1", 181 | 182 | "mmi17r,I1": "mmi13r,O2", 183 | "mmi16r,I1": "mmi13r,O1", 184 | "mmi15r,I1": "mmi12r,O2", 185 | "mmi14r,I1": "mmi12r,O1", 186 | "mmi13r,I1": "mmi11r,O2", 187 | "mmi12r,I1": "mmi11r,O1", 188 | "mmi27r,I1": "mmi23r,O2", 189 | "mmi26r,I1": "mmi23r,O1", 190 | "mmi25r,I1": "mmi22r,O2", 191 | "mmi24r,I1": "mmi22r,O1", 192 | "mmi23r,I1": "mmi21r,O2", 193 | "mmi22r,I1": "mmi21r,O1", 194 | "mmi37r,I1": "mmi33r,O2", 195 | "mmi36r,I1": "mmi33r,O1", 196 | "mmi35r,I1": "mmi32r,O2", 197 | "mmi34r,I1": "mmi32r,O1", 198 | "mmi33r,I1": "mmi31r,O2", 199 | "mmi32r,I1": "mmi31r,O1", 200 | "mmi47r,I1": "mmi43r,O2", 201 | "mmi46r,I1": "mmi43r,O1", 202 | "mmi45r,I1": "mmi42r,O2", 203 | "mmi44r,I1": "mmi42r,O1", 204 | "mmi43r,I1": "mmi41r,O2", 205 | "mmi42r,I1": "mmi41r,O1", 206 | "mmi57r,I1": "mmi53r,O2", 207 | "mmi56r,I1": "mmi53r,O1", 208 | "mmi55r,I1": "mmi52r,O2", 209 | "mmi54r,I1": "mmi52r,O1", 210 | "mmi53r,I1": "mmi51r,O2", 211 | "mmi52r,I1": "mmi51r,O1", 212 | "mmi67r,I1": "mmi63r,O2", 213 | "mmi66r,I1": "mmi63r,O1", 214 | "mmi65r,I1": "mmi62r,O2", 215 | "mmi64r,I1": "mmi62r,O1", 216 | "mmi63r,I1": "mmi61r,O2", 217 | "mmi62r,I1": "mmi61r,O1", 218 | "mmi77r,I1": "mmi73r,O2", 219 | "mmi76r,I1": "mmi73r,O1", 220 | "mmi75r,I1": "mmi72r,O2", 221 | "mmi74r,I1": "mmi72r,O1", 222 | "mmi73r,I1": "mmi71r,O2", 223 | "mmi72r,I1": "mmi71r,O1", 224 | "mmi87r,I1": "mmi83r,O2", 225 | "mmi86r,I1": "mmi83r,O1", 226 | "mmi85r,I1": "mmi82r,O2", 227 | "mmi84r,I1": "mmi82r,O1", 228 | "mmi83r,I1": "mmi81r,O2", 229 | "mmi82r,I1": "mmi81r,O1", 230 | 231 | "mmi14l,O1": "mmi14r,O1", 232 | "mmi14l,O2": "mmi24r,O1", 233 | "mmi15l,O1": "mmi34r,O1", 234 | "mmi15l,O2": "mmi44r,O1", 235 | "mmi16l,O1": "mmi54r,O1", 236 | "mmi16l,O2": "mmi64r,O1", 237 | "mmi17l,O1": "mmi74r,O1", 238 | "mmi17l,O2": "mmi84r,O1", 239 | "mmi24l,O1": "mmi14r,O2", 240 | "mmi24l,O2": "mmi24r,O2", 241 | "mmi25l,O1": "mmi34r,O2", 242 | "mmi25l,O2": "mmi44r,O2", 243 | "mmi26l,O1": "mmi54r,O2", 244 | "mmi26l,O2": "mmi64r,O2", 245 | "mmi27l,O1": "mmi74r,O2", 246 | "mmi27l,O2": "mmi84r,O2", 247 | "mmi34l,O1": "mmi15r,O1", 248 | "mmi34l,O2": "mmi25r,O1", 249 | "mmi35l,O1": "mmi35r,O1", 250 | "mmi35l,O2": "mmi45r,O1", 251 | "mmi36l,O1": "mmi55r,O1", 252 | "mmi36l,O2": "mmi65r,O1", 253 | "mmi37l,O1": "mmi75r,O1", 254 | "mmi37l,O2": "mmi85r,O1", 255 | "mmi44l,O1": "mmi15r,O2", 256 | "mmi44l,O2": "mmi25r,O2", 257 | "mmi45l,O1": "mmi35r,O2", 258 | "mmi45l,O2": "mmi45r,O2", 259 | "mmi46l,O1": "mmi55r,O2", 260 | "mmi46l,O2": "mmi65r,O2", 261 | "mmi47l,O1": "mmi75r,O2", 262 | "mmi47l,O2": "mmi85r,O2", 263 | "mmi54l,O1": "mmi16r,O1", 264 | "mmi54l,O2": "mmi26r,O1", 265 | "mmi55l,O1": "mmi36r,O1", 266 | "mmi55l,O2": "mmi46r,O1", 267 | "mmi56l,O1": "mmi56r,O1", 268 | "mmi56l,O2": "mmi66r,O1", 269 | "mmi57l,O1": "mmi76r,O1", 270 | "mmi57l,O2": "mmi86r,O1", 271 | "mmi64l,O1": "mmi16r,O2", 272 | "mmi64l,O2": "mmi26r,O2", 273 | "mmi65l,O1": "mmi36r,O2", 274 | "mmi65l,O2": "mmi46r,O2", 275 | "mmi66l,O1": "mmi56r,O2", 276 | "mmi66l,O2": "mmi66r,O2", 277 | "mmi67l,O1": "mmi76r,O2", 278 | "mmi67l,O2": "mmi86r,O2", 279 | "mmi74l,O1": "mmi17r,O1", 280 | "mmi74l,O2": "mmi27r,O1", 281 | "mmi75l,O1": "mmi37r,O1", 282 | "mmi75l,O2": "mmi47r,O1", 283 | "mmi76l,O1": "mmi57r,O1", 284 | "mmi76l,O2": "mmi67r,O1", 285 | "mmi77l,O1": "mmi77r,O1", 286 | "mmi77l,O2": "mmi87r,O1", 287 | "mmi84l,O1": "mmi17r,O2", 288 | "mmi84l,O2": "mmi27r,O2", 289 | "mmi85l,O1": "mmi37r,O2", 290 | "mmi85l,O2": "mmi47r,O2", 291 | "mmi86l,O1": "mmi57r,O2", 292 | "mmi86l,O2": "mmi67r,O2", 293 | "mmi87l,O1": "mmi77r,O2", 294 | "mmi87l,O2": "mmi87r,O2" 295 | }, 296 | "ports": { 297 | "I1": "mmi11l,I1", 298 | "I2": "mmi21l,I1", 299 | "I3": "mmi31l,I1", 300 | "I4": "mmi41l,I1", 301 | "I5": "mmi51l,I1", 302 | "I6": "mmi61l,I1", 303 | "I7": "mmi71l,I1", 304 | "I8": "mmi81l,I1", 305 | 306 | "O1": "mmi11r,I1", 307 | "O2": "mmi21r,I1", 308 | "O3": "mmi31r,I1", 309 | "O4": "mmi41r,I1", 310 | "O5": "mmi51r,I1", 311 | "O6": "mmi61r,I1", 312 | "O7": "mmi71r,I1", 313 | "O8": "mmi81r,I1" 314 | } 315 | }, 316 | "models": { 317 | "mmi": "mmi1x2" 318 | } 319 | } 320 | -------------------------------------------------------------------------------- /PICBench/agent.py: -------------------------------------------------------------------------------- 1 | import google.generativeai as genai 2 | from openai import OpenAI 3 | from anthropic import Anthropic 4 | from typing import List, Optional 5 | 6 | 7 | class LLMAgent: 8 | def __init__(self, api_key: str, model: str = "gpt-4"): 9 | """ 10 | Initialize the LLM Agent with API key and model type. 11 | Supports GPT (OpenAI), Claude (Anthropic), and Gemini (Google). 12 | """ 13 | self.api_key = api_key 14 | self.model = model 15 | self.model_class = self._determine_model_class(model) 16 | self.client = self._initialize_client() 17 | self.current_conversation_history = [] 18 | 19 | def _determine_model_class(self, model: str) -> str: 20 | """ 21 | Determine the model class (gpt, claude, gemini) from the model string. 22 | """ 23 | if model == "o1-mini": 24 | return "gpt" 25 | return model.split("-")[0] 26 | 27 | def _initialize_client(self): 28 | """ 29 | Initialize the appropriate client based on the model class. 30 | """ 31 | if self.model_class == "gpt": 32 | return OpenAI(api_key=self.api_key) 33 | elif self.model_class == "claude": 34 | return Anthropic(api_key=self.api_key) 35 | elif self.model_class == "gemini": 36 | genai.configure(api_key=self.api_key, transport="rest") 37 | return genai.GenerativeModel(model_name=self.model) 38 | else: 39 | raise ValueError(f"Unsupported model class: {self.model_class}") 40 | 41 | def _call_api(self, messages: List[dict]): 42 | if self.model_class == 'gpt': 43 | try: 44 | response = self.client.chat.completions.create( 45 | model=self.model, 46 | messages=messages 47 | ) 48 | return response.choices[0].message.content 49 | except Exception as e: 50 | return f"Error calling API: {e}" 51 | elif self.model_class == 'gemini': 52 | try: 53 | response = self.client.generate_content(contents=messages) 54 | return response.text 55 | except Exception as e: 56 | return f"Error calling API: {e}" 57 | elif self.model_class == 'claude': 58 | try: 59 | response = self.client.messages.create( 60 | model=self.model, 61 | messages=messages 62 | ) 63 | except Exception as e: 64 | return f"Error calling API: {e}" 65 | return response.content 66 | 67 | def _format_message(self, system_prompt, example_a, example_q, user_question): 68 | """ 69 | Initialize the appropriate messages format based on the model class. 70 | """ 71 | if self.model_class == 'gpt': 72 | if self.model == 'o1-mini': 73 | messages = [ 74 | {"role": "user", "content": system_prompt}, 75 | {"role": "user", "content": example_q}, 76 | {"role": "assistant", "content": example_a}, 77 | {"role": "user", "content": user_question}, 78 | ] 79 | else: 80 | messages = [ 81 | {"role": "system", "content": system_prompt}, 82 | {"role": "user", "content": example_q}, 83 | {"role": "assistant", "content": example_a}, 84 | {"role": "user", "content": user_question}, 85 | ] 86 | elif self.model_class == 'gemini': 87 | messages = [ 88 | {"role": "user", "parts": system_prompt}, 89 | {"role": "user", "parts": example_q}, 90 | {"role": "model", "parts": example_a}, 91 | {"role": "user", "parts": user_question}, 92 | ] 93 | elif self.model_class == 'claude': 94 | messages = [ 95 | {"role": "user", "content": system_prompt}, 96 | {"role": "user", "content": example_q}, 97 | {"role": "assistant", "content": example_a}, 98 | {"role": "user", "content": user_question}, 99 | ] 100 | else: 101 | raise ValueError(f"Unsupported model class: {self.model_class}") 102 | return messages 103 | 104 | def ASK_LLM(self, system_prompt, user_question: str): 105 | """ 106 | A single standalone call without any history tracking. 107 | """ 108 | example_q = "Create a Mach-Zehnder interferometer (MZI) with a single input and output, featuring a path length difference of L. Use the built-in multimode interferometer (MMI) component. \nParameters:\nL = 10 microns \n\nDesign the circuit and generate the corresponding JSON netlist based on the description. Try to understand the requirements and give reasoning steps in natural language to achieve it." 109 | example_a = "\nTo create a Mach-Zehnder Interferometer (MZI) with one input and one output using the built-in MMI component, we need the following steps:\n\n1. **Components Needed**:\n - Two MMIs (acting as splitters and combiners).\n - Two waveguides (one with default length, one with an additional 10 microns to create the length difference).\n\n2. **Instances**:\n - `mmi1`: First MMI splitter.\n - `waveguide_top`: Waveguide with length = default length + 10 microns.\n - `waveguide_bottom`: Waveguide with default length.\n - `mmi2`: Second MMI combiner.\n\n3. **Connections**:\n - Connect output ports of `mmi1` to inputs of the two waveguides.\n - Connect outputs of the waveguides to inputs of `mmi2`.\n\n4. **Ports**:\n - Define the input port connected to `mmi1`.\n - Define the output port from `mmi2`.\n\n5. **Length Difference**:\n - Set `waveguide_top` length to default length + 10 microns.\n\n\n{\n \"netlist\":{\n \"instances\": {\n \"mmi1\": \"mmi\",\n \"waveguide_top\": {\"component\": \"waveguide\", \"settings\": {\"length\": 20}},\n \"waveguide_bottom\": \"waveguide\",\n \"mmi2\": \"mmi\"\n },\n \"connections\": {\n \"mmi1,O1\": \"waveguide_bottom,I1\",\n \"waveguide_bottom,O1\": \"mmi2,I1\",\n \"mmi1,O2\": \"waveguide_top,I1\",\n \"waveguide_top,O1\": \"mmi2,I1\"\n },\n \"ports\": {\n \"I1\": \"mmi1,I1\",\n \"O1\": \"mmi2,O1\"\n }\n },\n \"models\":{\n \"mmi\": \"mmi1x2\",\n \"waveguide\": \"straight\"\n }\n}" 110 | 111 | messages = self._format_message(system_prompt, example_a, example_q, user_question) 112 | return self._call_api(messages) 113 | 114 | def ASK_LLM_iterate(self, system_prompt, user_question: str, clear_context: bool = False): 115 | """ 116 | Handles iterative calls with optional context clearing. 117 | If `clear_context` is True, it starts a new conversation. 118 | """ 119 | example_q = "Create a Mach-Zehnder interferometer (MZI) with a single input and output, featuring a path length difference of L. Use the built-in multimode interferometer (MMI) component. \nParameters:\nL = 10 microns \n\nDesign the circuit and generate the corresponding JSON netlist based on the description. Try to understand the requirements and give reasoning steps in natural language to achieve it." 120 | example_a = "\nTo create a Mach-Zehnder Interferometer (MZI) with one input and one output using the built-in MMI component, we need the following steps:\n\n1. **Components Needed**:\n - Two MMIs (acting as splitters and combiners).\n - Two waveguides (one with default length, one with an additional 10 microns to create the length difference).\n\n2. **Instances**:\n - `mmi1`: First MMI splitter.\n - `waveguide_top`: Waveguide with length = default length + 10 microns.\n - `waveguide_bottom`: Waveguide with default length.\n - `mmi2`: Second MMI combiner.\n\n3. **Connections**:\n - Connect output ports of `mmi1` to inputs of the two waveguides.\n - Connect outputs of the waveguides to inputs of `mmi2`.\n\n4. **Ports**:\n - Define the input port connected to `mmi1`.\n - Define the output port from `mmi2`.\n\n5. **Length Difference**:\n - Set `waveguide_top` length to default length + 10 microns.\n\n\n{\n \"netlist\":{\n \"instances\": {\n \"mmi1\": \"mmi\",\n \"waveguide_top\": {\"component\": \"waveguide\", \"settings\": {\"length\": 20}},\n \"waveguide_bottom\": \"waveguide\",\n \"mmi2\": \"mmi\"\n },\n \"connections\": {\n \"mmi1,O1\": \"waveguide_bottom,I1\",\n \"waveguide_bottom,O1\": \"mmi2,I1\",\n \"mmi1,O2\": \"waveguide_top,I1\",\n \"waveguide_top,O1\": \"mmi2,I1\"\n },\n \"ports\": {\n \"I1\": \"mmi1,I1\",\n \"O1\": \"mmi2,O1\"\n }\n },\n \"models\":{\n \"mmi\": \"mmi1x2\",\n \"waveguide\": \"straight\"\n }\n}" 121 | 122 | if clear_context or not self.current_conversation_history: 123 | # Start a new conversation 124 | self.current_conversation_history = self._format_message(system_prompt, example_a, example_q, user_question) 125 | 126 | if self.model_class == 'gpt': 127 | # Add user question to the conversation history 128 | self.current_conversation_history.append({"role": "user", "content": user_question}) 129 | 130 | # Call the API with the current conversation history 131 | response = self._call_api(self.current_conversation_history) 132 | 133 | # Append assistant's response to the conversation history 134 | self.current_conversation_history.append({"role": "assistant", "content": response}) 135 | 136 | elif self.model_class == 'gemini': 137 | self.current_conversation_history.append({"role": "user", "parts": user_question}) 138 | response = self._call_api(self.current_conversation_history) 139 | self.current_conversation_history.append({"role": "model", "parts": response}) 140 | 141 | elif self.model_class == 'claude': 142 | self.current_conversation_history.append({"role": "user", "content": user_question}) 143 | response = self._call_api(self.current_conversation_history) 144 | self.current_conversation_history.append({"role": "assistant", "content": response}) 145 | else: 146 | raise ValueError(f"Unsupported model class: {self.model_class}") 147 | return response 148 | 149 | def start_new_conversation(self): 150 | """ 151 | Resets the conversation history for a new problem context. 152 | """ 153 | self.current_conversation_history = [] 154 | -------------------------------------------------------------------------------- /PICBench/gen_data.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import os 3 | from openai import OpenAI 4 | from datetime import datetime 5 | import json 6 | project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) 7 | sys.path.append(project_root) 8 | from evaluation import evaluate 9 | from pathlib import Path 10 | from agent import LLMAgent 11 | from scipy.special import comb 12 | 13 | 14 | def cal_passk(dic_list, n, k): 15 | print(dic_list) 16 | # syntax 17 | sum_list = [] 18 | for design in dic_list.keys(): 19 | c = dic_list[design]['syntax check passed'] + dic_list[design]['functional check passed'] 20 | sum_list.append(1 - comb(n - c, k) / comb(n, k)) 21 | syntax_passk = sum(sum_list) / len(sum_list) 22 | 23 | # func 24 | sum_list = [] 25 | for design in dic_list.keys(): 26 | c = dic_list[design]['functional check passed'] 27 | sum_list.append(1 - comb(n - c, k) / comb(n, k)) 28 | func_passk = sum(sum_list) / len(sum_list) 29 | print(f'syntax pass@{k}: {syntax_passk}, func pass@{k}: {func_passk}') 30 | 31 | 32 | def get_dict(file_path): 33 | with open(file_path, 'r',encoding='gbk') as file: 34 | return json.load(file) 35 | 36 | def extract_design_names(directory_path): 37 | try: 38 | # Get a list of all subdirectories in the specified directory 39 | design_names = [folder_name for folder_name in os.listdir(directory_path) 40 | if os.path.isdir(os.path.join(directory_path, folder_name))] 41 | 42 | return design_names 43 | except Exception as e: 44 | print(f"An error occurred: {e}") 45 | return [] 46 | 47 | 48 | def load_design_dict(design_names): 49 | instruction_dict = {} 50 | for design_name in design_names: 51 | base_path = Path("../testcases") / design_name 52 | file_path = base_path / f"{design_name}_problem_description.txt" 53 | try: 54 | with open(file_path, 'r', encoding='utf-8') as file: 55 | instruction_dict[design_name] = file.read().split('Problem Description-')[1] 56 | except FileNotFoundError: 57 | print(f"Error: Problem description file not found for {design_name}.") 58 | return "" 59 | return instruction_dict 60 | 61 | 62 | def gen_result_feedback_passk(LLM_agent, design_name, design_dict, prompt, restriction_label, num_feedback, k, n): 63 | error_dict_init = { 64 | 'syntax check passed': 0, 65 | 'functional check passed': 0 66 | } 67 | netlist_responses = {} 68 | netlist_responses_single = {} 69 | full_responses = {} 70 | dict_list = {} 71 | for i in range(0, len(design_name)): 72 | dict_list[design_name[i]] = error_dict_init.copy() 73 | feedback_flag = True 74 | full_responses[design_name[i]] = [] 75 | netlist_responses[design_name[i]] = [] 76 | print(f"design_name: {design_name[i]}") 77 | for times in range(0, n): 78 | single_flag = False 79 | if times == 0: 80 | netlist_responses_single[design_name[i]] = [] 81 | single_flag = True 82 | print("cnt: ", times) 83 | label = True 84 | LLM_agent.start_new_conversation() 85 | question = design_dict[design_name[i]] + '\n' + prompt 86 | with open("system_prompt.txt", 'r') as file: 87 | system_prompt = file.read() 88 | with open("restrictions.txt", 'r') as file: 89 | restrictions = file.read() 90 | full_system_prompt = system_prompt + '\n' + restrictions 91 | if restriction_label: 92 | response = LLM_agent.ASK_LLM_iterate(full_system_prompt, question) 93 | else: 94 | response = LLM_agent.ASK_LLM_iterate(system_prompt, question) 95 | print(f"init response_{times}: {response}") 96 | try: 97 | netlist = response.split('\n')[1] 98 | if netlist.split('\n')[-1] == '': 99 | netlist = '\n'.join(netlist.split('\n')[:-1]) 100 | elif netlist.split('\n')[-2] == '': 101 | netlist = '\n'.join(netlist.split('\n')[:-2]) 102 | elif netlist.split('\n')[0] == '```json': 103 | netlist = '\n'.join(netlist.split('\n')[1:-1]) 104 | elif netlist.split('\n')[-1] == '```': 105 | netlist = '\n'.join(netlist.split('\n')[:-1]) 106 | if netlist: 107 | netlist_responses[design_name[i]].append(netlist) 108 | if single_flag: 109 | netlist_responses_single[design_name[i]].append(netlist) 110 | eval_res = evaluate(netlist, design_name[i]) 111 | else: 112 | eval_res = f'no result part, please make sure the result is in the correct format: \n analysis \n \n result' 113 | except: 114 | eval_res = f'no result part, please make sure the result is in the correct format: \n analysis \n \n result' 115 | print(f'eval_{design_name[i]}_init_{times}: {eval_res}') 116 | full_responses[design_name[i]].append(response) 117 | 118 | if eval_res.startswith('functional check passed'): 119 | dict_list[design_name[i]]['functional check passed'] += 1 120 | feedback_flag = False 121 | elif eval_res.startswith('functional error'): 122 | dict_list[design_name[i]]['syntax check passed'] += 1 123 | label = False 124 | 125 | if feedback_flag: 126 | for cnt in range(0, num_feedback): 127 | refine_prompt = "Here are the errors in previously generated code. \n Please follow the restrictions and write entire code by fixing the errors in previous code. \nPlease only give me the code in the part, for anything beside the code, please properly comment it out in part." 128 | question = refine_prompt + '\n' + eval_res 129 | response = LLM_agent.ASK_LLM_iterate(full_system_prompt, question) 130 | print(f"feedback {cnt} response: {response}") 131 | try: 132 | netlist = response.split('\n')[1] 133 | if netlist.split('\n')[-1] == '': 134 | netlist = '\n'.join(netlist.split('\n')[:-1]) 135 | elif netlist.split('\n')[-2] == '': 136 | netlist = '\n'.join(netlist.split('\n')[:-2]) 137 | elif netlist.split('\n')[0] == '```json': 138 | netlist = '\n'.join(netlist.split('\n')[1:-1]) 139 | elif netlist.split('\n')[-1] == '```': 140 | netlist = '\n'.join(netlist.split('\n')[:-1]) 141 | if netlist: 142 | netlist_responses[design_name[i]].append(netlist) 143 | if single_flag: 144 | netlist_responses_single[design_name[i]].append(netlist) 145 | eval_res = evaluate(netlist, design_name[i]) 146 | else: 147 | eval_res = f'no result part, please make sure the result is in the correct format: \n analysis \n \n result' 148 | except: 149 | eval_res = f'no result part, please make sure the result is in the correct format: \n analysis \n \n result' 150 | print(f'eval_{design_name[i]}_{times}_feedback_{cnt}: {eval_res}') 151 | full_responses[design_name[i]].append(response) 152 | 153 | if eval_res.startswith('functional check passed'): 154 | dict_list[design_name[i]]['functional check passed'] += 1 155 | break 156 | elif eval_res.startswith('functional error') and label: 157 | dict_list[design_name[i]]['syntax check passed'] += 1 158 | label = False 159 | 160 | cal_passk(dict_list, n, k) 161 | 162 | with open(f'log_{args.model}_pass{k}_res{num_feedback}.json', 'w') as file: 163 | json.dump(netlist_responses, file) 164 | 165 | 166 | def PICBench(path, restriction_label, max_iterations, pass_k, total_samples, model, api_key): 167 | """ 168 | Main function to process the workflow. 169 | 170 | :param path: Path to the test cases and solutions. 171 | :param restriction_label: Boolean indicating if restrictions apply. 172 | :param max_iterations: Maximum iterations of error feedback. 173 | :param pass_k: Pass@k value. 174 | :param total_samples: The total number of samples generated. 175 | :param model: The model to be used (e.g., GPT-4, Gemini). 176 | :param api_key: API key for the LLM agent. 177 | """ 178 | print(f"[INFO] Starting PICBench...") 179 | print('-----------------------------------------------------') 180 | print(f"[INFO] Parameters received:") 181 | print(f" Path: {path}") 182 | print(f" Restriction Label: {restriction_label}") 183 | print(f" Max Iterations: {max_iterations}") 184 | print(f" Pass@k: {pass_k}") 185 | print(f" Total Samples: {total_samples}") 186 | print(f" Model: {model}") 187 | print(f" API Key: {'[HIDDEN]' if api_key else '[MISSING]'}") 188 | print('-----------------------------------------------------') 189 | 190 | problem_prompt = "Design the circuit and generate the corresponding JSON netlist based on the description. Try to understand the requirements and give reasoning steps in natural language to achieve it. In addition, try to give advice to avoid syntax error based on the restrictions." 191 | 192 | # Initialize the LLM agent with the specified model 193 | LLM_agent = LLMAgent(api_key=api_key, model=model) 194 | 195 | # Use existing functions to process the designs 196 | design_names = extract_design_names(path) 197 | instruction_dict = load_design_dict(design_names) 198 | 199 | # Generate feedback and results 200 | gen_result_feedback_passk( 201 | LLM_agent, design_names, instruction_dict, problem_prompt, restriction_label, max_iterations, pass_k, total_samples 202 | ) 203 | 204 | 205 | if __name__ == '__main__': 206 | api_key = your own api key 207 | 208 | import argparse 209 | 210 | parser = argparse.ArgumentParser(description="PIC design generation and evaluation") 211 | parser.add_argument("--path", type=str, default="../testcases", help="Path to the test cases.") 212 | parser.add_argument("--restriction_label", type=bool, default=True, help="Apply restrictions (True/False).") 213 | parser.add_argument("--max_iterations", type=int, default=3, help="Maximum iterations of error feedback.") 214 | parser.add_argument("--pass_k", type=int, default=1, help="Pass@k.") 215 | parser.add_argument("--total_samples", type=int, default=5, help="Total number n of samples to generate.") 216 | parser.add_argument("--model", type=str, default="gpt-4", help="Language model to use.") 217 | parser.add_argument("--api_key", type=str, default=api_key, help="API key for the LLM.") 218 | 219 | args = parser.parse_args() 220 | 221 | # Execute the main function 222 | PICBench( 223 | path=args.path, 224 | restriction_label=args.restriction_label, 225 | max_iterations=args.max_iterations, 226 | pass_k=args.pass_k, 227 | total_samples=args.total_samples, 228 | model=args.model, 229 | api_key=args.api_key 230 | ) 231 | -------------------------------------------------------------------------------- /testcases/MZM/MZM_res.json: -------------------------------------------------------------------------------- 1 | {"I1_O1": [1.0, 1.0, 0.9999999999999998, 1.0, 1.0000000000000009, 0.9999999999999996, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 0.9999999999999996, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0, 0.9999999999999996, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 0.9999999999999998, 0.9999999999999998, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000009, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 0.9999999999999998, 1.0, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 0.9999999999999998, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 0.9999999999999998, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999996, 1.0, 1.0000000000000009, 1.0000000000000009, 1.0000000000000004, 1.0, 0.9999999999999998, 0.9999999999999998, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0, 0.9999999999999998, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 0.9999999999999996, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 0.9999999999999996, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 0.9999999999999998, 1.0, 1.0000000000000009, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000009, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000009, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999996, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000009, 0.9999999999999996, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 1.0, 1.0, 1.0, 1.0000000000000009, 1.0000000000000009, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0, 0.9999999999999996, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999996, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 0.9999999999999996, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000013, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000009, 0.9999999999999996, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000009, 0.9999999999999998, 0.9999999999999996, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 0.9999999999999998, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000009, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 1.0, 0.9999999999999998, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 0.9999999999999998, 1.0000000000000009, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 0.9999999999999998, 1.0, 1.0000000000000009, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000009, 0.9999999999999998, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999996, 1.0000000000000009, 1.0000000000000004, 1.0000000000000009, 1.0000000000000009, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000009, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0, 0.9999999999999998, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 0.9999999999999996, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 1.0, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000009, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 0.9999999999999998, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0000000000000004, 1.0, 1.0, 0.9999999999999998, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0000000000000009, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0, 1.0, 1.0, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0000000000000009, 1.0, 1.0, 0.9999999999999996, 1.0, 1.0000000000000004, 1.0000000000000004, 1.0000000000000004, 1.0]} -------------------------------------------------------------------------------- /testcases/64-QAM modulator/64-QAM modulator_res.json: -------------------------------------------------------------------------------- 1 | {"I1_O1": [0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000029, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000036, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000036, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000026, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000036, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000033, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000033, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000028, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029]} -------------------------------------------------------------------------------- /testcases/8-QAM modulator/8-QAM modulator_res.json: -------------------------------------------------------------------------------- 1 | {"I1_O1": [0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000029, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000036, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000036, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000026, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000036, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000033, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000033, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000028, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000033, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000033, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000033, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000032, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.500000000000003, 0.5000000000000032, 0.5000000000000033, 0.5000000000000029]} -------------------------------------------------------------------------------- /testcases/Direct modulator/Direct modulator_res.json: -------------------------------------------------------------------------------- 1 | {"I1_O1": [0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000024, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000024, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.500000000000003, 0.5000000000000026, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000032, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.5000000000000026, 0.500000000000003, 0.5000000000000026, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000024, 0.5000000000000028, 0.500000000000003, 0.5000000000000024, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000024, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000032, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000026, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.5000000000000026, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000024, 0.500000000000003, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000024, 0.5000000000000028, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000024, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000033, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000032, 0.5000000000000028, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000024, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.500000000000003, 0.5000000000000029, 0.5000000000000032, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000024, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.5000000000000024, 0.5000000000000028, 0.5000000000000029, 0.5000000000000032, 0.5000000000000028, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000024, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000032, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000024, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000026, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.500000000000003, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.5000000000000032, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000026, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000024, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000032, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000032, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.5000000000000026, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000026, 0.5000000000000026, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000026, 0.5000000000000026, 0.5000000000000029, 0.5000000000000029, 0.5000000000000026, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.500000000000003, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000026, 0.5000000000000029, 0.5000000000000026, 0.5000000000000029, 0.500000000000003, 0.5000000000000029, 0.500000000000003, 0.5000000000000028, 0.5000000000000028, 0.500000000000003, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.500000000000003, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000032, 0.5000000000000029, 0.5000000000000028, 0.5000000000000028, 0.5000000000000029, 0.5000000000000029, 0.5000000000000029, 0.500000000000003, 0.5000000000000029]} -------------------------------------------------------------------------------- /testcases/WDM_demux/WDM_demux_res.json: -------------------------------------------------------------------------------- 1 | {"I1_O1": [0.9864757745289574, 0.9872631934691823, 0.987966386122597, 0.9885969246418626, 0.9891644061640349, 0.9896768470037358, 0.990140987307607, 0.9905625287759485, 0.9909463218146204, 0.9912965140988037, 0.9916166694175134, 0.9919098634296442, 0.9921787613364726, 0.9924256812813737, 0.9926526464028431, 0.9928614278048278, 0.9930535802092255, 0.9932304716756254, 0.9933933084823869, 0.9935431560386285, 0.9936809565219886, 0.9938075438004422, 0.9939236560888456, 0.9940299467055345, 0.9941269932263015, 0.9942153052783664, 0.9942953311729654, 0.9943674635391038, 0.9944320440917863, 0.9944893676435521, 0.9945396854479687, 0.9945832079465895, 0.9946201069762262, 0.9946505174806481, 0.9946745387595819, 0.9946922352775321, 0.9947036370454372, 0.9947087395788953, 0.9947075034275593, 0.9946998532607775, 0.9946856764846245, 0.9946648213543827, 0.9946370945342805, 0.9946022580421202, 0.9945600254999043, 0.9945100575918822, 0.9944519566079355, 0.9943852599214221, 0.9943094322155172, 0.9942238562286074, 0.9941278217351157, 0.9940205124104423, 0.9939009901429174, 0.9937681762470854, 0.9936208288936164, 0.993457515892239, 0.9932765817324225, 0.9930761074840256, 0.992853861762759, 0.9926072404385128, 0.9923331920612768, 0.9920281250318363, 0.9916877912561023, 0.991307139253719, 0.9908801272392918, 0.9903994832563936, 0.9898563945674097, 0.9892401014976532, 0.9885373607356582, 0.9877317280350896, 0.9868025876828453, 0.985723821662919, 0.9844619579744611, 0.9829735528858811, 0.9812014249197405, 0.9790691315267893, 0.9764726941079542, 0.9732679040893286, 0.9692503309880476, 0.9641228974521168, 0.9574415315025394, 0.9485206682442946, 0.9362621261686441, 0.9188313265251294, 0.8930169657061728, 0.8529195433234552, 0.7872850625729575, 0.6750820865293135, 0.4877418223530161, 0.2562848855867419, 0.18389805460627562, 0.35898905599667064, 0.5844804775808192, 0.7340368310760913, 0.82116928823011, 0.8729522835732402, 0.9053097519513728, 0.9265671729854157, 0.9411523549247955, 0.9515290850684879, 0.9591359633913321, 0.9648511959989171, 0.9692323939893319, 0.9726459405052439, 0.9753398104667316, 0.9774861781238804, 0.9792072268628044, 0.980591272957908, 0.9817031161173567, 0.9825908437742634, 0.9832903958711123, 0.9838286780975805, 0.9842257101492979, 0.9844961154342237, 0.984650147919019, 0.984694381656214, 0.9846321424328379, 0.9844637291016698, 0.9841864483462385, 0.9837944667062211, 0.9832784643749827, 0.9826250534373493, 0.9818158951147312, 0.9808264109922761, 0.9796239239709127, 0.9781649723331766, 0.9763913916021526, 0.9742245124460818, 0.9715564028133188, 0.9682363449678034, 0.9640494015955248, 0.9586814186780553, 0.9516599345211768, 0.942250586757228, 0.9292677820795373, 0.9107128150136433, 0.8830507140492522, 0.839717265858443, 0.7680996256727605, 0.6449469546482104, 0.4432955053576413, 0.22210911224280475, 0.19997588026274127, 0.40398643915278054, 0.6163885489316037, 0.7492873592543009, 0.8257829029011863, 0.8710281142595142, 0.8989932719680422, 0.916914170662745, 0.9286332576820598, 0.9362748692078506, 0.9410517113483892, 0.9436617891847239, 0.9444888848321205, 0.9437031127063142, 0.9413051427172183, 0.937132088554642, 0.9308280942061423, 0.9217695999733532, 0.9089169373914585, 0.8905294859716909, 0.8636094931697342, 0.8227887913188633, 0.7581217506079697, 0.6514674024096403, 0.477651024858389, 0.2554908164628219, 0.15572441400549744, 0.2700780657243928, 0.4108776904202611, 0.41941967703096145, 0.28727636413506014, 0.15771532909506786, 0.24210634884331855, 0.4676801628547264, 0.6485169681726868, 0.759291311494411, 0.8263332066116611, 0.8688228452824087, 0.8971816940858176, 0.9169951241621386, 0.9313786632442685, 0.942157264449058, 0.9504507780299035, 0.9569753987142021, 0.9622059839131618, 0.9664673879511904, 0.9699879791183232, 0.9729321611345954, 0.9754207885705666, 0.977544358951199, 0.9793717602002873, 0.9809562064613553, 0.9823393504616675, 0.9835541863886427, 0.9846271340123146, 0.985579558204031, 0.9864288924833006, 0.9871894805372867, 0.9878732140013098, 0.9884900211226754, 0.9890482449622833, 0.9895549388495367, 0.9900160992058195, 0.9904368505018768, 0.9908215933022787, 0.9911741236024563, 0.9914977296624887, 0.9917952710692566, 0.9920692436649527, 0.9923218331605411, 0.9925549596337111, 0.9927703146394996, 0.9929693923000049, 0.993153515460347, 0.9933238577806044, 0.9934814624633773, 0.9936272581826897, 0.9937620726737051, 0.9938866443582604, 0.9940016323134315, 0.994107624835789, 0.9942051468098304, 0.9942946660531408, 0.9943765987813802, 0.9944513143119914, 0.9945191391054948, 0.9945803602265177, 0.9946352282927046, 0.9946839599677721, 0.9947267400448639, 0.9947637231575545, 0.9947950351482232, 0.9948207741165738, 0.9948410111649122, 0.9948557908509641, 0.9948651313534079, 0.9948690243498948, 0.9948674346017817, 0.9948602992340236, 0.9948475266925003, 0.9948289953542986, 0.9948045517588352, 0.9947740084189995, 0.9947371411614241, 0.9946936859330209, 0.9946433349968078, 0.9945857324229069, 0.9945204687600989, 0.9944470747479051, 0.99436501389836, 0.9942736737382102, 0.9941723554546645, 0.9940602616282024, 0.9939364816608951, 0.993799974413716, 0.993649547445398, 0.9934838320903214, 0.9933012534130516, 0.9930999938175761, 0.9928779487497816, 0.9926326724845879, 0.9923613113954702, 0.9920605213093286, 0.9917263644766073, 0.9913541802239999, 0.990938421344486, 0.9904724454806153, 0.9899482468215702, 0.9893561078350359, 0.988684142686225, 0.9879176922100741, 0.9870385128334201, 0.9860236755398931, 0.9848440506853526, 0.9834621916285595, 0.9818293301320865, 0.979881033835077, 0.9775308052274954, 0.9746604386464538, 0.9711051380562723, 0.9666299230298125, 0.9608910843077996, 0.9533710737151694, 0.9432643577790942, 0.9292690043564471, 0.9091895123955046, 0.8791487974536604, 0.8319884939634523, 0.7541760921474577, 0.6219543377873477, 0.413889843399513, 0.2084383939802318, 0.21144086389638345, 0.41917732150733655, 0.6254515081887992, 0.7558843158995142, 0.8325767359615228, 0.8790381771154125, 0.9086010451444556, 0.9283174466738678, 0.9420101321187144, 0.9518457987734927, 0.9591101884833674, 0.9645990772092253, 0.968823645260893, 0.97212305840558, 0.9747287315502748, 0.976802388886816, 0.9784593613426947, 0.9797832708760821, 0.9808355263227212, 0.981661600605723, 0.9822952555913821, 0.9827614228915192, 0.9830781799818364, 0.9832580983807789, 0.9833091391542945, 0.9832352052231694, 0.9830364149489929, 0.9827091280645365, 0.982245726985046, 0.9816341290108874, 0.9808569731502653, 0.9798903834366854, 0.9787021502879383, 0.9772490792276209, 0.9754731094179285, 0.9732955628094557, 0.9706084751374067, 0.967261244768525, 0.9630395466679964, 0.9576310572602276, 0.9505678963759584, 0.9411263797766783, 0.9281452438976621, 0.909681518749328, 0.8823308319115597, 0.8398436466010285, 0.7703684442670204, 0.6522650128254882, 0.4593220975999254, 0.23688418401118713, 0.1886423821085329, 0.37226175411595624, 0.5892957051270792, 0.7312591271845534, 0.814052575735062, 0.8632042996293355, 0.8936480892964357, 0.9132362813897602, 0.9261620251071365, 0.9347538380944065, 0.9403530392418694, 0.9437496114962777, 0.94540566823418, 0.9455724766622752, 0.9443505499380438, 0.9417159938419758, 0.9375230515953525, 0.9314848906697825, 0.9231281359753611, 0.9117085691648796, 0.8960622640913956, 0.8743423530071731, 0.8435465698666105, 0.7986634331465217, 0.7311887448313299, 0.6270981907506414, 0.4678218570523376, 0.25535671369542645, 0.08619457701787746, 0.04545885042999441, 0.0902952875811403, 0.26741680437616955, 0.48016219438073904, 0.6368341352431081, 0.7390131209143385, 0.8055759616975706, 0.8502594536353071, 0.8813296343565676, 0.9036603387970508, 0.9201861859510831, 0.9327307073942751, 0.9424646061862536, 0.9501629245021985, 0.9563533148010339, 0.9614041437915041, 0.9655784235360075, 0.9690677603215367, 0.9720142834249456, 0.9745251479502737, 0.9766823351824553, 0.9785494065284949, 0.9801762422060915, 0.9816024209695795, 0.9828596671225126, 0.9839736468867606, 0.9849653040433476, 0.9858518647764121, 0.9866476019417787, 0.9873644222775054, 0.9880123218507622, 0.9885997424287581, 0.9891338526290007, 0.9896207714408188, 0.990065747219342, 0.9904733019989027, 0.9908473485912543, 0.991191286174986, 0.9915080787715836, 0.9918003200186444, 0.9920702869047741, 0.992319984561512, 0.9925511837704147, 0.992765452504895, 0.9929641825632222, 0.9931486121425549, 0.9933198450415278, 0.993478867049832, 0.9936265599808967, 0.9937637137214222, 0.9938910366054725, 0.9940091643674624, 0.9941186678847798, 0.9942200598855258, 0.9943138007677012, 0.9944003036522258, 0.9944799387725164, 0.9945530372867015, 0.9946198945849918, 0.9946807731530125, 0.9947359050423089, 0.9947854939907532, 0.9948297172286205, 0.9948687269998583, 0.9949026518226634, 0.9949315975087857, 0.994955647956586, 0.9949748657289832, 0.9949892924237228, 0.9949989488398423, 0.995003834940797, 0.9950039296110672, 0.9949991901996312, 0.994989551839675, 0.9949749265297698, 0.9949552019571939, 0.9949302400386927, 0.9948998751480789, 0.9948639119930609, 0.9948221230955094, 0.9947742458196226, 0.9947199788809371, 0.9946589782550924, 0.99459085238841, 0.9945151565917272, 0.9944313864737363, 0.9943389702389633, 0.9942372596371012, 0.9941255193024976, 0.9940029141627129, 0.99386849451964, 0.9937211783112931, 0.9935597299409408, 0.9933827349048412, 0.9931885692494286, 0.9929753626289552, 0.9927409533952639, 0.9924828337045885, 0.9921980820343028, 0.9918832797109495, 0.9915344069835836, 0.9911467127246283, 0.9907145498454344, 0.9902311657450859, 0.9896884332254932, 0.9890765017895127, 0.988383341308225, 0.9875941384886404, 0.9866904894932309, 0.9856493064225037, 0.9844413162313517, 0.9830289698119152, 0.9813634825399519, 0.9793805714300643, 0.9769941952728349, 0.9740871643196185, 0.9704967177130525, 0.9659917835864262, 0.9602360641305279, 0.9527261334904873, 0.9426838404055062, 0.9288618180399281, 0.9091772010277768, 0.8799947504165941, 0.8346926552572608, 0.7609159272338216, 0.6369751981969346, 0.44040183186719867, 0.22772502607331999, 0.193438193336034, 0.37701221091073867, 0.5904436579096878, 0.7326040107641139, 0.8172563429843289, 0.8685519338699885, 0.9010808052876416, 0.9226840657876891, 0.9376241618297105, 0.9483132280165733, 0.9561782651470125, 0.9620993848929392, 0.9666399392877866, 0.9701724147227317, 0.9729500951951611, 0.9751493756791312, 0.9768955818089302, 0.9782791913662191, 0.9793662877944989, 0.9802054424859074, 0.9808323222916805, 0.9812728064785091, 0.9815450968219221, 0.9816611225491524, 0.9816274275789469, 0.9814456521899574, 0.9811126678146603, 0.9806203811717442, 0.9799551844046177, 0.9790969840335475, 0.9780176849633122, 0.9766789246891396, 0.9750287283796814, 0.9729965555648654, 0.9704858764219769, 0.9673628442833636, 0.9634386188405127, 0.9584410424648322, 0.9519678643529579, 0.9434068173544132, 0.9317938048303404, 0.915550795134561, 0.8919809024327612, 0.8562616158369383, 0.7994316175509112, 0.7048529287895007, 0.5467518886591604, 0.3239942927122866, 0.17712548974362438, 0.2674524543851979, 0.49058518778245525, 0.66781183011198, 0.7752009868969945, 0.8386095637154453, 0.8773399477219659, 0.9019591064351195, 0.9180986198778116, 0.9288492967079957, 0.9359718783423696, 0.9404984749971291, 0.9430386067932006, 0.9439389111033141, 0.9433664283501161, 0.941348394098533, 0.9377832980746982, 0.9324277244862289, 0.9248556944663922, 0.9143781328945156, 0.8998952271087348, 0.8796259659982963, 0.8506015509453891, 0.8076970230953108, 0.7418160111100127, 0.6371318780762573, 0.4722653709640475, 0.25840444273066904, 0.1313974845059707, 0.17328852226917296, 0.20524347619113137, 0.14042318308884313, 0.16932081243757843, 0.3566224315682551, 0.5545485449198814, 0.6905279581369456, 0.7765745716498078, 0.8320506391981183, 0.8692792199969586, 0.8952881423666577, 0.9141157372861802, 0.9281642987168844, 0.9389198964088831, 0.9473365884651648, 0.9540477079006641, 0.9594863096425583, 0.9639563291578755, 0.9676760465431651, 0.9708054531953556, 0.9734639620420165, 0.9757421553488718, 0.9777097529669398, 0.9794211268651069, 0.9809191877744827, 0.9822381702960651, 0.9834056590848427, 0.9844440834654008, 0.9853718340461592, 0.9862041067628086, 0.9869535478305448, 0.9876307515343297, 0.9882446480323579, 0.9888028081073865, 0.9893116846000067, 0.9897768051340287, 0.9902029270569506, 0.9905941628367617, 0.990954082186875, 0.991285795730929, 0.9915920239272975, 0.9918751541498219, 0.9921372881957768, 0.992380282012801, 0.9926057790675159, 0.9928152384918086, 0.9930099589188849, 0.9931910987453777, 0.9933596934167739, 0.9935166702228896, 0.9936628610019529, 0.9937990130810255, 0.9939257987232049, 0.9940438233058823, 0.9941536324164914, 0.9942557180213186, 0.9943505238377325, 0.9944384500190857, 0.9945198572443968, 0.9945950702903867, 0.9946643811514911, 0.994728051763303, 0.9947863163763542, 0.9948393836200237, 0.9948874382900502, 0.9949306428879234, 0.9949691389357914, 0.9950030480865881, 0.995032473045442, 0.9950574983153909, 0.9950781907774223, 0.9950946001124149, 0.9951067590697751, 0.9951146835855156, 0.9951183727498115, 0.9951178086220167, 0.9951129558883762, 0.9951037613553154, 0.9950901532682042, 0.9950720404424909, 0.9950493111906343, 0.9950218320243092, 0.9949894461068739, 0.9949519714257457, 0.9949091986483519, 0.9948608886177338, 0.9948067694355701, 0.9947465330696434, 0.9946798314104658, 0.9946062716865768, 0.9945254111294967, 0.9944367507568294, 0.9943397281142453, 0.9942337087828201, 0.9941179764157179, 0.9939917210151872, 0.9938540250943747, 0.9937038472847202, 0.9935400028434862, 0.99336114038063, 0.9931657139506225, 0.9929519494306558, 0.9927178038155237, 0.9924609156783044, 0.9921785445436269, 0.9918674962528322, 0.9915240305061465, 0.9911437455588167, 0.990721433400391, 0.9902508964767506, 0.989724713856316, 0.9891339402973093, 0.9884677153438376, 0.987712750450872, 0.986852648793557, 0.9858669926200799, 0.9847301031736365, 0.9834093324798346, 0.9818626749010416, 0.980035372655444, 0.9778550044544395, 0.9752242381079096, 0.9720099009653057, 0.9680260958780226, 0.9630074126940824, 0.9565651460107749, 0.9481133500617002, 0.9367393667154946, 0.9209681956296746, 0.8983166041526576, 0.8644214882716094, 0.8113284305170027, 0.7244710379060358, 0.5805658275156645, 0.3692002932841635, 0.19226766390750155, 0.22616007448546926, 0.43292904334831595, 0.6278546285839183, 0.7527985717421571, 0.8278759084213331, 0.8741819113176027, 0.9040426783448208, 0.9241525139334557, 0.9382154581496881, 0.9483642815290015, 0.9558801360048641, 0.9615635334746219, 0.9659324938879407, 0.9693326120733861, 0.9720005539766668, 0.9741019813427557, 0.9757549186348365, 0.9770445480213157, 0.9780327956192421, 0.9787646563147845, 0.9792724145002447, 0.9795784629222202, 0.979697150765056, 0.9796359243112234, 0.9793959140661456, 0.9789720447791139, 0.9783526825424683, 0.9775187736298161, 0.9764423612105115, 0.9750842742739664, 0.9733906469300914, 0.9712877108618407, 0.9686739476729339, 0.9654080782659306, 0.961290288084297, 0.9560321162244956, 0.9492067093045119, 0.9401638376604858, 0.9278792419800541, 0.9106767973245821, 0.8856957348856429, 0.8478385051046844, 0.7877133659198982, 0.6882603223621968, 0.5248871367587268, 0.3049186507037754, 0.175260532112496, 0.27565649536270986, 0.49464569297415995, 0.6670653808753416, 0.7725114522651614, 0.8353665501117036, 0.8740085212129126, 0.8986449493848495, 0.9147760957431514, 0.9254407425548006, 0.9323714217565251, 0.936574147939173, 0.9386237309926749, 0.9388149574064237, 0.9372351420804459, 0.9337870392362799, 0.9281710160372019, 0.9198201963261998, 0.9077637139732136, 0.89036076714803, 0.864782541243812, 0.8259859817799161, 0.7647122774417541, 0.664252064758304, 0.5010195457530068, 0.2852361415499044, 0.16440243145789593, 0.2628742700351381, 0.45486730087290383, 0.5817555268485689, 0.6226569110784946, 0.5860673791077162, 0.4657853803037784, 0.2780740269524113, 0.165357591073884, 0.26333599939589475, 0.4754869672357497, 0.6471436782837907, 0.7555878352654511, 0.8225866662536702, 0.8655265339052028, 0.8943493853720141, 0.9145444221741755, 0.9292268512266, 0.9402395444640621, 0.9487195303976179, 0.9553960334143704, 0.96075315073401, 0.9651221723445288, 0.9687359595188672, 0.9717620908469045, 0.9743237031414662, 0.9765129672103207, 0.9784000236516723, 0.9800390443198539, 0.9814724292955329, 0.9827337674307388, 0.9838499603262862, 0.9848427698069792, 0.985729961385321, 0.9865261601974693, 0.9872434993872394, 0.9878921166948942, 0.9884805386760723, 0.9890159807967995, 0.9895045838892745, 0.9899516019942373, 0.9903615527287882, 0.9907383385197563, 0.9910853450049323, 0.9914055214067945, 0.9917014465714256, 0.9919753835328473, 0.992229324834402, 0.9924650303603624, 0.9926840590640791, 0.9928877956956593, 0.9930774734119157, 0.9932541929789526, 0.993418939142122, 0.9935725946305176, 0.9937159521778869, 0.9938497248730784, 0.9939745550982766, 0.9940910222686755, 0.9941996495510539, 0.9943009097092264, 0.9943952302001822, 0.9944829976247967, 0.9945645616205031, 0.9946402382697925, 0.9947103130868955, 0.9947750436355134, 0.9948346618225334, 0.9948893759057827, 0.9949393722482558, 0.9949848168462536, 0.995025856654772, 0.9950626207297509, 0.9950952212037076, 0.9951237541085012, 0.9951483000564353, 0.9951689247888017, 0.9951856795988157, 0.9951986016341627, 0.9952077140824918, 0.9952130262414798, 0.9952145334735365, 0.9952122170432914, 0.9952060438344787, 0.9951959659408396, 0.9951819201236861, 0.9951638271266208, 0.9951415908354928, 0.9951150972688512, 0.9950842133810982, 0.9950487856569243, 0.9950086384713372, 0.9949635721847846, 0.994913360936954, 0.9948577500959531, 0.9947964533114103, 0.9947291491100083, 0.9946554769602034, 0.9945750327183434, 0.994487363350936, 0.9943919608063488, 0.9942882548829126, 0.9941756049080525, 0.9940532900028348, 0.9939204976563657, 0.993776310272, 0.9936196892685908, 0.9934494562207321, 0.9932642703955036, 0.9930626018815736, 0.9928426992985354, 0.9926025508049061, 0.9923398367717164, 0.992051872027096, 0.9917355349661033, 0.9913871800048782, 0.9910025287610894, 0.9905765338532032, 0.9901032071695588, 0.9895754016313522, 0.9889845315173956, 0.9883202108172, 0.9875697810514957, 0.9867176883420533, 0.9857446523447263, 0.9846265439903062, 0.9833328499657432, 0.981824541524934, 0.9800510700851445, 0.977946058954768, 0.9754210085347308, 0.9723559073399474, 0.9685849052501974, 0.9638738940056261, 0.9578844300266848, 0.9501138588020042, 0.9397925150374011, 0.9257006563350951, 0.9058299588883467, 0.8767359882062842, 0.8322794853605586, 0.7612999457299215, 0.6446664715937819, 0.4615799919298732, 0.25072131510973805, 0.18045136348368915, 0.32555976547926857, 0.5392391507473904, 0.6954399523442413, 0.7915113858651801, 0.8502718812862174, 0.8875684491950686, 0.9122813507201937, 0.9293102852085949, 0.9414414801512, 0.9503241816974963, 0.9569741090076651, 0.9620397807427258, 0.965948589060837, 0.9689899613108284, 0.9713643983380601, 0.9732133254802816, 0.9746377777843303, 0.975710372793438, 0.9764831192556287, 0.9769925584502483, 0.9772631345172504, 0.9773093349341164, 0.9771369224721606, 0.9767434347447905, 0.9761180208452818, 0.9752405926418591, 0.9740801715456521, 0.9725921890098971, 0.9707143217219201, 0.9683601637246533, 0.9654095755325178, 0.9616937530413336, 0.9569716353616866, 0.9508916414417787, 0.9429277004807712, 0.9322686007062113, 0.9176193692865057, 0.8968309152688265, 0.866185859851697, 0.8190039402807813, 0.7430951882859888, 0.6179482332576878, 0.4251192119229736, 0.22325572486255518, 0.18964121097203473, 0.36036995257877397, 0.5672965397567639, 0.7094632724867269, 0.7952749374720973, 0.8472287704480722, 0.8796822184761455, 0.9005198594207197, 0.914047791576794, 0.9226700479897237, 0.9277449425253911, 0.9300155082830455, 0.9298217143976263, 0.927191401818166, 0.921849004829565, 0.9131456669547355, 0.8998808866535699, 0.8799349435613526, 0.8495347060021696, 0.8018003994737491, 0.7240969015863902, 0.5953625135661221, 0.39917590188579277]} -------------------------------------------------------------------------------- /testcases/MZI_ps/MZI_ps_res.json: -------------------------------------------------------------------------------- 1 | {"I1_O1": [0.05050821881155113, 0.05216383644240046, 0.05384448198370031, 0.05555005288126998, 0.05728044523145071, 0.05903555378795624, 0.0608152719688163, 0.06261949186336185, 0.06444810423930282, 0.06630099854986668, 0.06817806294098729, 0.07007918425857772, 0.0720042480558841, 0.07395313860085853, 0.07592573888365602, 0.07792193062412908, 0.07994159427948498, 0.08198460905187051, 0.08405085289614908, 0.08614020252769268, 0.08825253343018367, 0.09038771986355325, 0.09254563487199105, 0.09472615029188898, 0.09692913676004632, 0.0991544637217233, 0.10140199943890855, 0.10367161099856942, 0.1059631643210291, 0.10827652416826847, 0.11061155415244327, 0.11296811674436026, 0.11534607328202966, 0.1177452839792728, 0.12016560793442219, 0.12260690313900226, 0.12506902648653292, 0.12755183378134935, 0.130055179747489, 0.1325789180376061, 0.13512290124198637, 0.13768698089756906, 0.1402710074970247, 0.1428748304979113, 0.14549829833186095, 0.14814125841376524, 0.1508035571511585, 0.15348503995344306, 0.1561855512413332, 0.15890493445625845, 0.16164303206983477, 0.164399685593353, 0.1671747355874174, 0.16996802167146727, 0.1727793825334385, 0.1756086559395192, 0.17845567874378643, 0.18132028689808236, 0.18420231546172294, 0.18710159861142917, 0.19001796965124088, 0.19295126102235277, 0.19590130431317135, 0.1988679302693223, 0.20185096880368417, 0.20485024900644583, 0.20786559915531033, 0.21089684672553868, 0.21394381840025337, 0.21700634008062644, 0.22008423689610707, 0.22317733321475142, 0.22628545265355768, 0.22940841808882578, 0.23254605166651393, 0.2356981748126962, 0.23886460824400932, 0.2420451719781174, 0.24523968534425258, 0.2484479669937121, 0.2516698349104869, 0.2549051064217941, 0.2581535982087226, 0.2614151263168723, 0.26468950616707115, 0.2679765525660144, 0.27127607971697143, 0.2745879012306188, 0.2779118301357176, 0.2812476788899271, 0.2845952593906653, 0.2879543829858322, 0.2913248604847607, 0.2947065021690774, 0.29809911780351817, 0.3015025166468967, 0.3049165074630275, 0.3083408985316507, 0.31177549765942236, 0.31522011219083146, 0.3186745490192021, 0.3221386145977704, 0.3256121149506576, 0.3290948556838343, 0.3325866419962789, 0.3360872786909533, 0.33959657018590417, 0.34311432052538265, 0.3466403333907985, 0.35017441211197237, 0.3537163596781631, 0.3572659787491829, 0.36082307166654803, 0.3643874404646088, 0.36795888688163814, 0.3715372123710497, 0.37512221811247043, 0.3787137050229467, 0.38231147376810826, 0.38591532477322377, 0.3895250582345138, 0.39314047413019965, 0.3967613722317501, 0.40038755211497185, 0.4040188131712189, 0.40765495461853535, 0.4112957755128998, 0.41494107475927633, 0.41859065112279537, 0.4222443032400258, 0.4259018296299886, 0.4295630287053499, 0.4332276987836443, 0.4368956380983103, 0.4405666448098529, 0.4442405170170636, 0.4479170527679582, 0.451596050071087, 0.4552773069065072, 0.458960621236927, 0.4626457910187784, 0.4663326142133222, 0.4700208887976917, 0.47371041277593273, 0.47740098419006877, 0.4810924011311286, 0.4847844617501425, 0.48847696426919557, 0.4921697069923301, 0.49586248831662616, 0.4995551067430679, 0.5032473608875211, 0.5069390494916646, 0.5106299714339214, 0.5143199257402854, 0.5180087115952562, 0.5216961283526429, 0.5253819755464194, 0.5290660529015874, 0.5327481603448482, 0.5364280980154816, 0.5401056662760951, 0.5437806657232515, 0.5474528971982806, 0.5511221617979317, 0.5547882608849657, 0.5584509960988672, 0.5621101693664496, 0.5657655829123888, 0.5694170392697555, 0.5730643412906715, 0.5767072921566699, 0.580345695389231, 0.5839793548602623, 0.5876080748024096, 0.5912316598195528, 0.5948499148971236, 0.5984626454123649, 0.602069657144753, 0.6056707562861544, 0.6092657494510652, 0.6128544436869308, 0.61643664648412, 0.6200121657861924, 0.623580809999955, 0.6271423880055224, 0.6306967091663587, 0.6342435833392204, 0.6377828208841864, 0.6413142326745346, 0.6448376301065613, 0.6483528251095892, 0.6518596301555851, 0.655357858269045, 0.6588473230366915, 0.6623278386171277, 0.665799219750579, 0.6692612817683369, 0.6727138406025126, 0.6761567127953859, 0.6795897155090148, 0.6830126665346455, 0.6864253843020495, 0.6898276878889358, 0.693219397030246, 0.6966003321273724, 0.6999703142574994, 0.7033291651826172, 0.70667670735876, 0.7100127639450596, 0.7133371588127625, 0.716649716554246, 0.7199502624919376, 0.7232386226872259, 0.7265146239492941, 0.729778093843872, 0.7330288607021064, 0.7362667536291227, 0.7394916025127541, 0.7427032380320836, 0.7459014916660307, 0.7490861957018651, 0.752257183243571, 0.7554142882202833, 0.7585573453946727, 0.7616861903711338, 0.7648006596040937, 0.7679005904061776, 0.7709858209562737, 0.7740561903076963, 0.7771115383961593, 0.7801517060476828, 0.783176534986559, 0.7861858678432482, 0.789179548162045, 0.7921574204089128, 0.7951193299791481, 0.7980651232049468, 0.8009946473630477, 0.8039077506821778, 0.806804282350539, 0.8096840925231487, 0.8125470323292805, 0.8153929538795596, 0.8182217102733672, 0.8210331556058372, 0.8238271449750293, 0.8266035344889767, 0.8293621812725607, 0.8321029434745129, 0.8348256802742345, 0.8375302518885852, 0.8402165195785753, 0.8428843456560752, 0.8455335934903785, 0.8481641275147571, 0.8507758132329372, 0.853368517225488, 0.8559421071561752, 0.85849645177826, 0.8610314209407068, 0.8635468855943075, 0.8660427177978339, 0.8685187907239866, 0.8709749786653953, 0.8734111570405331, 0.8758272023994739, 0.8782229924297151, 0.8805984059618545, 0.8829533229751774, 0.8852876246033149, 0.8876011931396189, 0.8898939120426778, 0.8921656659416308, 0.8944163406414746, 0.8966458231283122, 0.898854001574458, 0.9010407653435644, 0.9032060049956255, 0.905349612291928, 0.9074714801999675, 0.909571502898191, 0.911649575780816, 0.9137055954624693, 0.9157394597827739, 0.9177510678109627, 0.9197403198502236, 0.921707117442215, 0.9236513633713277, 0.9255729616689324, 0.9274718176176319, 0.9293478377552875, 0.9312009298791452, 0.9330310030497514, 0.9348379675948979, 0.9366217351134057, 0.9383822184789491, 0.9401193318436807, 0.9418329906418796, 0.9435231115935341, 0.9451896127077466, 0.9468324132861756, 0.9484514339263754, 0.9500465965250243, 0.9516178242811485, 0.953165041699212, 0.9546881745921536, 0.9561871500844029, 0.9576618966147178, 0.9591123439390541, 0.9605384231333101, 0.9619400665959899, 0.9633172080508311, 0.9646697825493493, 0.9659977264732653, 0.9673009775369272, 0.9685794747896289, 0.969833158617824, 0.971061970747343, 0.9722658542454488, 0.9734447535228871, 0.9745986143358385, 0.9757273837877958, 0.9768310103313631, 0.9779094437700067, 0.9789626352597041, 0.9799905373105366, 0.9809931037881897, 0.9819702899154356, 0.9829220522734549, 0.9838483488031556, 0.9847491388064123, 0.9856243829471744, 0.986474043252585, 0.9872980831139682, 0.9880964672877438, 0.98886916189633, 0.989616134428876, 0.9903373537420183, 0.9910327900605026, 0.9917024149777486, 0.9923462014563509, 0.9929641238285055, 0.9935561577963514, 0.9941222804322511, 0.9946624701790033, 0.9951767068499646, 0.9956649716291125, 0.9961272470710424, 0.9965635171008803, 0.996973767014118, 0.9973579834764038, 0.997716154523223, 0.9980482695595437, 0.9983543193593704, 0.9986342960652221, 0.9988881931875591, 0.999116005604117, 0.9993177295591841, 0.9994933626628039, 0.9996429038899004, 0.9997663535793422, 0.9998637134329313, 0.9999349865143194, 0.999980177247858, 0.9999992914173769, 0.9999923361648905, 0.9999593199892348, 0.9999002527446407, 0.9998151456392268, 0.9997040112334318, 0.9995668634383711, 0.9994037175141344, 0.9992145900679992, 0.9989994990525859, 0.9987584637639477, 0.9984915048395773, 0.9981986442563631, 0.9978799053284612, 0.9975353127051125, 0.9971648923683848, 0.9967686716308458, 0.9963466791331781, 0.9958989448417158, 0.9954255000459222, 0.9949263773557999, 0.9944016106992293, 0.9938512353192416, 0.9932752877712369, 0.9926738059201231, 0.9920468289373874, 0.9913943972981257, 0.9907165527779721, 0.9900133384499921, 0.9892847986814974, 0.9885309791308013, 0.9877519267439122, 0.9869476897511381, 0.9861183176636833, 0.9852638612701117, 0.984384372632803, 0.9834799050843273, 0.9825505132237402, 0.9815962529128304, 0.9806171812723242, 0.9796133566779811, 0.9785848387566832, 0.9775316883824179, 0.9764539676722089, 0.9753517399820226, 0.9742250699025641, 0.9730740232550382, 0.9718986670868537, 0.9706990696672649, 0.9694753004829222, 0.9682274302334344, 0.9669555308267948, 0.9656596753748113, 0.9643399381884334, 0.9629963947730309, 0.961629121823648, 0.9602381972201697, 0.9588237000224258, 0.95738571046523, 0.9559243099534522, 0.9544395810568802, 0.9529316075051802, 0.9514004741826848, 0.9498462671232026, 0.9482690735047316, 0.9466689816441267, 0.9450460809917397, 0.9434004621259542, 0.9417322167477392, 0.9400414376750482, 0.9383282188372785, 0.9365926552696088, 0.9348348431072754, 0.9330548795798597, 0.9312528630054913, 0.9294288927849336, 0.9275830693957745, 0.9257154943863961, 0.923826270370008, 0.9219155010186019, 0.9199832910568372, 0.9180297462559138, 0.916054973427329, 0.9140590804166906, 0.9120421760973876, 0.9100043703642664, 0.9079457741272652, 0.9058664993049086, 0.9037666588179205, 0.9016463665826577, 0.8995057375045282, 0.8973448874714224, 0.895163933346992, 0.8929629929640085, 0.8907421851176084, 0.8885016295584556, 0.8862414469860006, 0.8839617590414853, 0.8816626883011448, 0.8793443582691916, 0.8770068933708199, 0.8746504189451867, 0.8722750612383129, 0.8698809473959708, 0.8674682054565376, 0.8650369643437955, 0.8625873538596597, 0.8601195046769552, 0.8576335483320663, 0.8551296172176128, 0.852607844575057, 0.8500683644872703, 0.8475113118710699, 0.8449368224697452, 0.8423450328454959, 0.8397360803719052, 0.8371101032263132, 0.8344672403821886, 0.8318076316014531, 0.829131417426801, 0.826438739173945, 0.8237297389238487, 0.8210045595149773, 0.8182633445353832, 0.8155062383149043, 0.8127333859173016, 0.8099449331322206, 0.8071410264673877, 0.8043218131405144, 0.8014874410713698, 0.7986380588736836, 0.7957738158470979, 0.7928948619690972, 0.7900013478868616, 0.7870934249091762, 0.7841712449981415, 0.781234960761089, 0.7782847254423394, 0.775320692914881, 0.7723430176721855, 0.76935185481986, 0.7663473600673436, 0.7633296897195777, 0.7602990006686157, 0.7572554503852307, 0.7541991969105473, 0.7511303988475695, 0.7480492153527484, 0.7449558061275218, 0.7418503314097702, 0.7387329519654023, 0.7356038290797345, 0.732463124548973, 0.7293110006716679, 0.7261476202401101, 0.7229731465317487, 0.7197877433005317, 0.7165915747683101, 0.7133848056161881, 0.7101676009758527, 0.7069401264208817, 0.7037025479580826, 0.7004550320187279, 0.6971977454498975, 0.6939308555057133, 0.6906545298385738, 0.6873689364904811, 0.6840742438841099, 0.6807706208142371, 0.6774582364387388, 0.6741372602699786, 0.67080786216582, 0.6674702123209597, 0.6641244812579857, 0.6607708398185829, 0.6574094591547166, 0.6540405107197428, 0.6506641662595158, 0.647280597803608, 0.6438899776563203, 0.6404924783879549, 0.6370882728257853, 0.6336775340452455, 0.6302604353610265, 0.6268371503181489, 0.6234078526830998, 0.6199727164349322, 0.6165319157563096, 0.6130856250246539, 0.6096340188031948, 0.6061772718320932, 0.6027155590195098, 0.5992490554326863, 0.5957779362890837, 0.5923023769473744, 0.5888225528986294, 0.5853386397573905, 0.5818508132527093, 0.5783592492192845, 0.5748641235886129, 0.5713656123799781, 0.5678638916916423, 0.5643591376919314, 0.5608515266103974, 0.5573412347288141, 0.5538284383724382, 0.5503133139010844, 0.5467960377002513, 0.543276786172324, 0.5397557357276351, 0.536233062775726, 0.5327089437164649, 0.5291835549311856, 0.5256570727739989, 0.5221296735628211, 0.518601533570738, 0.5150728290171176, 0.5115437360589083, 0.508014430781803, 0.5044850891915689, 0.500955887205233, 0.49742700064242046, 0.4938986052166231, 0.49037087652649913, 0.4868439900471619, 0.4833181211215667, 0.47979344495181075, 0.4762701365904876, 0.4727483709321033, 0.46922832270445364, 0.4657101664599809, 0.4621940765672694, 0.4586802272024363, 0.45516879234062546, 0.45165994574746265, 0.44815386097057175, 0.44465071133100237, 0.4411506699149335, 0.4376539095650196, 0.43416060287216107, 0.43067092216691977, 0.42718503951130143, 0.42370312669020843, 0.42022535520323356, 0.4167518962563469, 0.4132829207534271, 0.4098185992882084, 0.4063591021358792, 0.4029045992448663, 0.39945526022868283, 0.39601125435771917, 0.39257275055105617, 0.3891399173683817, 0.38571292300185545, 0.38229193526799876, 0.3788771215997372, 0.3754686490382322, 0.37206668422501754, 0.3686713933939141, 0.3652829423631375, 0.36190149652739967, 0.3585272208499354, 0.35516027985474213, 0.3518008376186666, 0.34844905776364005, 0.34510510344889855, 0.34176913736322523, 0.3384413217172769, 0.3351218182358225, 0.33181078815017656, 0.32850839219056105, 0.3252147905784565, 0.321930143019113, 0.3186546086940009, 0.31538834625335266, 0.3121315138086135, 0.30888426892515053, 0.3056467686147491, 0.30241916932829954, 0.29920162694852, 0.2959942967825789, 0.292797333554924, 0.2896108914000517, 0.2864351238552577, 0.28327018385361546, 0.2801162237167475, 0.2769733951478508, 0.27384184922459337, 0.27072173639217, 0.2676132064562988, 0.2645164085763335, 0.2614314912583939, 0.2583586023484652, 0.255297889025664, 0.25224949779540334, 0.24921357448272904, 0.24619026422560333, 0.24317971146823358, 0.24018205995456476, 0.2371974527215383, 0.23422603209279097, 0.23126793967194922, 0.22832331633636804, 0.22539230223062862, 0.22247503676019842, 0.2195716585851453, 0.21668230561384053, 0.21380711499669852, 0.21094622312007794, 0.20809976560006035, 0.20526787727632154, 0.20245069220621945, 0.19964834365857848, 0.1968609641079171, 0.19408868522840272, 0.1913316378880013, 0.18858995214262642, 0.18586375723042242, 0.18315318156592109, 0.1804583527343984, 0.17777939748625063, 0.17511644173129542, 0.17246961053332044, 0.16983902810450152, 0.1672248177999404, 0.1646271021122896, 0.16204600266632724, 0.1594816402136697, 0.15693413462747396, 0.1544036048972245, 0.15189016912353198, 0.1493939445130573, 0.14691504737331026, 0.14445359310776154, 0.14200969621072532, 0.1395834702625269, 0.13717502792453046, 0.1347844809343737, 0.13241194010110122, 0.13005751530051715, 0.1277213154703803, 0.1254034486058988, 0.12310402175504158, 0.12082314101400918, 0.11856091152280289, 0.1163174374607223, 0.11409282204204822, 0.11188716751162597, 0.10970057514067637, 0.1075331452224517, 0.10538497706816248, 0.10325616900278589, 0.10114681836100216, 0.09905702148317856, 0.09698687371137098, 0.09493646938545382, 0.09290590183921402, 0.09089526339650247, 0.08890464536756608, 0.08693413804525127, 0.08498383070138735, 0.08305381158316302, 0.08114416790959433, 0.07925498586801946, 0.07738635061063899, 0.07553834625115895, 0.07371105586140882, 0.07190456146810242, 0.07011894404958209, 0.06835428353264318, 0.0666106587894261, 0.06488814763433089, 0.06318682682103169, 0.06150677203945777, 0.05984805791298585, 0.0582107579954723, 0.056594944768559224, 0.055000689638881925, 0.05342806293537885, 0.05187713390667613, 0.050347970718525134, 0.0488406404512204, 0.04735520909720076, 0.04589174155860776, 0.04445030164490758, 0.043030952070629645, 0.0416337544530638, 0.040258769310142925, 0.038906056058236466, 0.037575673010114025, 0.0362676773728772, 0.03498212524603456, 0.033719071619550435, 0.03247857037199541, 0.031260674268753584, 0.030065434960252338, 0.02889290298027382, 0.027743127744330274, 0.026616157548061646, 0.02551203956572179, 0.02443081984869723, 0.023372543324092804, 0.022337253793376727, 0.02132499393106663, 0.02033580528348153, 0.01936972826754956, 0.018426802169668834, 0.01750706514462583, 0.016610554214554506, 0.015737305267989776, 0.014887353058919618, 0.014060731205948983, 0.013257472191479554, 0.012477607360972571, 0.011721166922226354, 0.010988179944773472, 0.010278674359273605, 0.009592676956978123, 0.008930213389286366, 0.008291308167286368, 0.007675984661427683, 0.007084265101197565, 0.00651617057486691, 0.005971721029287202, 0.005450935269770093, 0.004953830959969179, 0.004480424621872912, 0.004030731635807693, 0.003604766240528046, 0.0032025415333358904, 0.002824069470276232, 0.0024693608663730582, 0.0021384253959237163, 0.001831271592849858, 0.0015479068511016244, 0.0012883374251137238, 0.0010525684303179924, 0.0008406038437133032, 0.0006524465044788528, 0.00048809811465545084, 0.0003475592398677623, 0.0002308293101109368, 0.00013790662058309428, 6.878833257452259e-05, 2.3470474410947556e-05, 1.947942448878016e-06, 4.2145021242018875e-06, 3.0262789054500926e-05, 8.008431019392855e-05, 0.00015366944504208537, 0.00025100744690250467, 0.00037208644419863966, 0.0005168934418382702, 0.0006854143226315434, 0.0008776338487620089, 0.001093535663308979, 0.0013331022918241981, 0.0015963151439530865, 0.0018831545151235553, 0.0021935995882617684, 0.002527628435583832, 0.0028852180204291156, 0.003266344199135602, 0.003670981722982483, 0.0040991042401750345, 0.004550684297876816, 0.005025693344300031, 0.005524101730847472, 0.006045878714289299, 0.006590992459012202, 0.00715941003929988, 0.007751097441676484, 0.008366019567287974, 0.009004140234343663, 0.00966542218059982, 0.01034982706589318, 0.011057315474732104, 0.011787846918919397, 0.012541379840242322, 0.013317871613191548, 0.014117278547761378, 0.014939555892238372, 0.015784657836119643, 0.016652537512992054, 0.01754314700354112, 0.018456437338525932, 0.019392358501878634, 0.020350859433784393, 0.021331888033869036, 0.022335391164376876, 0.023361314653418928, 0.02440960329830232, 0.025480200868813776, 0.026573050110680344, 0.027688092748922286, 0.028825269491395016, 0.02998452003227333, 0.03116578305563667, 0.03236899623906938, 0.03359409625733081, 0.03484101878603618, 0.03610969850542538, 0.03740006910413087, 0.03871206328299413, 0.04004561275900249, 0.041400648269130605, 0.042777099574349234, 0.04417489546359985, 0.045593963757873945, 0.047034231314250115, 0.04849562403008181, 0.04997806684709802, 0.05148148375569713, 0.05300579779911601, 0.054550931077772744, 0.056116804753613476, 0.05770333905441886, 0.05931045327830934, 0.06093806579811668, 0.06258609406593055, 0.06425445461758374, 0.06594306307730262, 0.06765183416221762, 0.06938068168709947, 0.07112951856899359, 0.07289825683194816, 0.07468680761182497, 0.07649508116103368, 0.07832298685340944, 0.08017043318908075, 0.08203732779938361, 0.08392357745178271, 0.08582908805491685, 0.08775376466352408, 0.08969751148359603, 0.09166023187739122, 0.09364182836860997, 0.09564220264752875, 0.097661255576195, 0.09969888719367183, 0.10175499672128399, 0.10382948256792622, 0.10592224233537541, 0.10803317282367829, 0.11016217003650293, 0.1123091291866365, 0.11447394470136013, 0.11665651022802109, 0.11885671863949221, 0.12107446203974834, 0.12330963176947933, 0.12556211841164994, 0.12783181179720163, 0.1301186010106678, 0.13242237439596466, 0.13474301956203116, 0.13708042338868492, 0.1394344720323088, 0.14180505093179926, 0.14419204481430437, 0.14659533770115998, 0.14901481291378105, 0.15145035307963003, 0.1539018401380905, 0.15636915534652504, 0.1588521792863194, 0.16135079186879317, 0.16386487234140348, 0.1663942992937429, 0.1689389506637171, 0.17149870374363874, 0.17407343518641222, 0.17666302101171347, 0.17926733661223992, 0.18188625675988282, 0.18451965561202918, 0.18716740671787382, 0.1898293830246191, 0.1925054568839524, 0.1951955000582397, 0.19789938372703722, 0.20061697849337717, 0.20334815439024362, 0.20609278088697267, 0.20885072689574732, 0.21162186077799197, 0.21440605035101049, 0.2172031628943283, 0.22001306515632146, 0.22283562336080573, 0.2256707032135117, 0.2285181699087511, 0.2313778881359319, 0.23424972208631425, 0.23713353545950092, 0.24002919147023943, 0.24293655285496824, 0.2458554818786105, 0.24878584034121334, 0.25172748958467966, 0.2546802904995242, 0.25764410353163025, 0.26061878868897914, 0.26360420554846586, 0.26660021326266925, 0.269606670566664, 0.2726234357848606, 0.2756503668378066, 0.27868732124905754, 0.2817341561520351, 0.284790728296838, 0.28785689405723996, 0.2909325094374778, 0.29401743007919395, 0.2971115112683438, 0.30021460794213134, 0.3033265746959304, 0.30644726579022774, 0.30957653515756844, 0.31271423640957013, 0.31586022284378046, 0.31901434745079915, 0.32217646292113916, 0.32534642165225935, 0.32852407575565046, 0.3317092770636639, 0.3349018771367104, 0.3381017272701341, 0.34130867850137225, 0.34452258161683835, 0.34774328715910663, 0.35097064543384554, 0.35420450651689067, 0.35744472026132945, 0.3606911363045185]} --------------------------------------------------------------------------------