Commit 0d6d85dd authored by Daniel Brown's avatar Daniel Brown

Merge branch 'develop'

parents f35f1bb8 fd1ca7c9
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>src</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>
# $Id$
# test
# Source Makefile for Finesse
#
# Todo: Makefile should recognise and extend gloable LDFLAGS rather than
# just CFLAGS (currently also used for linking)
#
SHELL = bash
.PHONY: clean tags cover_report test_clean api_clean
......@@ -14,7 +18,7 @@ ifeq "$(ARCH)" "linux"
endif
GSL_CFLAGS = ${shell gsl-config --cflags} -DHAVE_INLINE
CUBA_CFLAGS = -L../lib/Cuba-3.0 -lcuba
CUBA_CFLAGS = -L../lib/Cuba-3.2 -lcuba
ifeq "$(GSL_LIBS)" ""
ifeq "$(BUILD)" "win"
......@@ -69,7 +73,8 @@ KAT_SOURCES = kat.c \
kat_knm_bs.c \
kat_knm_int.c \
kat_thermal.c \
kat_knm_aperture.c
kat_knm_aperture.c \
kat_matrix_ccs.c
# the kat-specific objects
KAT_OBJECTS = $(KAT_SOURCES:.c=.o)
......@@ -80,12 +85,6 @@ INCLUDES = -I. $(KLUINCLUDES)
# the formulc objects
FORMULC_OBJECTS = ../lib/formulc/formulc.o ../lib/formulc/random.o
# the sparse objects and libraries
SPARSE_OBJECTS = ../lib/sparse/%.o
SPARSE_LIBS = ../lib/sparse/sparse.a
LIBS += $(SPARSE_LIBS)
KLU_LIBS = ../lib/KLUsparse/KLU/Lib/libklu.a ../lib/KLUsparse/BTF/Lib/libbtf.a ../lib/KLUsparse/COLAMD/Lib/libcolamd.a ../lib/KLUsparse/AMD/Lib/libamd.a
LIBS += $(KLU_LIBS)
......@@ -94,7 +93,7 @@ LIBS += $(SERVER_LIBS)
# the mac-specific libraries
ifeq "$(ARCH)" "mac"
LIBS += -Wl -lm
LIBS += -lm
else
LIBS += -lm
endif
......@@ -153,7 +152,7 @@ all: kat win test versionnumber
# make kat
kat: PROG = ../kat
kat: config $(PREREQS)
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make fast
fast: kat
......@@ -164,13 +163,13 @@ fast: kat
debug: CFLAGS = $(DEBUG_CFLAGS)
debug: PROG = ../kat
debug: config $(PREREQS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make nodebug
nodebug: CFLAGS = $(NODEBUG_CFLAGS)
nodebug: PROG = ../kat
nodebug: config $(PREREQS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make test
$(TEST_OBJECTS): CFLAGS = $(BASE_CFLAGS) -g
......@@ -180,7 +179,7 @@ test: CFLAGS = $(TEST_CFLAGS)
test: PROG = ../kat
test: OBJECTS += $(TEST_OBJECTS)
test: $(PREREQS) $(TEST_OBJECTS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
../kat --test
# make test cover
......@@ -191,20 +190,20 @@ test_cover: CFLAGS = $(TEST_COVER_CFLAGS)
test_cover: PROG = ../kat
test_cover: OBJECTS += $(TEST_OBJECTS)
test_cover: $(PREREQS) $(TEST_OBJECTS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
../kat --test
# make prof
prof: CFLAGS = $(PROF_CFLAGS)
prof: PROG = ../kat
prof: $(PREREQS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make cover (use the code coverage tool, gcov)
cover: CFLAGS = $(COVER_CFLAGS)
cover: PROG = ../kat
cover: $(PREREQS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make a report of code coverage information
cover_report:
......@@ -215,12 +214,12 @@ cover_report:
slow: CFLAGS = $(SLOW_CFLAGS)
slow: PROG = ../kat
slow: config $(PREREQS)
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
# make versionnumber
versionnumber: PROG := ../kat_$(GIT_SHA)
versionnumber: config $(PREREQS)
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) ${GSL_LIBS} ${CUBA_CFLAGS}
$(CC) $(FAST_CFLAGS) ${GSL_CFLAGS} -o $(PROG) $(OBJECTS) $(LIBS) $(LDFLAGS) ${GSL_LIBS} ${CUBA_CFLAGS}
### sundry other targets ###
......
This diff is collapsed.
This diff is collapsed.
......@@ -39,12 +39,16 @@
#include "kat_knm_bs.h"
#include "kat_knm_bayer.h"
#include "kat_knm_aperture.h"
#include "kat_calc.h"
#include <stdlib.h>
//#include <omp.h>
extern init_variables_t init;
extern interferometer_t inter;
extern options_t options;
extern local_var_t vlocal;
extern FILE *fp_log;
extern const complex_t complex_i; //!< sqrt(-1) or 0 + i
......@@ -177,12 +181,16 @@ complex_t k_nmnm(int n1, int m1, int n2, int m2, complex_t qx1, complex_t qy1,
}
}
} else {
// use coupling coefficients as in F. Bayer-Helms (see below)
if (n1 == vlocal.kn1 && n2 == vlocal.kn2 && ceq(vlocal.kqx1, qx1)
&& ceq(vlocal.kqx2, qx2) && (gamma_x == vlocal.kgammax)
&& (nr == vlocal.knr)) {
z1 = vlocal.zk1;
} else {
//omp_set_lock(&knmLock);
z1 = k_mm(n1, n2, qx1, qx2, gamma_x, nr);
vlocal.zk1 = z1;
vlocal.kn1 = n1;
......@@ -191,6 +199,7 @@ complex_t k_nmnm(int n1, int m1, int n2, int m2, complex_t qx1, complex_t qy1,
vlocal.kqx2 = qx2;
vlocal.kgammax = gamma_x;
vlocal.knr = nr;
//omp_unset_lock(&knmLock);
}
// -gammy_y, probably because of my definition of rotation as right-handed
......@@ -270,6 +279,7 @@ complex_t k_nmnm_new(int n1, int m1, int n2, int m2, complex_t qx1, complex_t qy
(inter.knm & 4 && !(gamma_x == 0.0 && gamma_y == 0.0)) || inter.knm & 8) {
*/
// added new knm debug for old routine
if (knm_flag & INT_BAYER_HELMS_OLD) {
if ((knm_flag & 1) && !options.quiet) {
z1 = k_mm(n1, n2, qx1, qx2, gamma_x, nr);
......@@ -297,12 +307,16 @@ complex_t k_nmnm_new(int n1, int m1, int n2, int m2, complex_t qx1, complex_t qy
}
}
} else {
// use coupling coefficients as in F. Bayer-Helms (see below)
// cache previously computed value for z1 if nothing has changed
if (n1 == vlocal.kn1 && n2 == vlocal.kn2 && ceq(vlocal.kqx1, qx1)
&& ceq(vlocal.kqx2, qx2) && (gamma_x == vlocal.kgammax)
&& (nr == vlocal.knr)) {
z1 = vlocal.zk1;
} else {
z1 = k_mm(n1, n2, qx1, qx2, gamma_x, nr);
vlocal.zk1 = z1;
vlocal.kn1 = n1;
......@@ -311,6 +325,7 @@ complex_t k_nmnm_new(int n1, int m1, int n2, int m2, complex_t qx1, complex_t qy
vlocal.kqx2 = qx2;
vlocal.kgammax = gamma_x;
vlocal.knr = nr;
}
// -gammy_y, probably because of my definition of rotation as right-handed
......@@ -1040,22 +1055,137 @@ int set_k_mirror(int mirror_index) {
_nr2 = nrL;
}
}
int n, m, n1, n2, m1, m2;
int num_fields = (int) (inter.tem + 1) * (inter.tem + 2) / 2;
int turn;
int n, m, n1, n2, m1, m2;
n1 = 0; //silence compiler warnings
n2 = 0;
m1 = 0;
m2 = 0;
// Now need to check if any signal tilts are affecting this mirror as the
// tilt coupling will need to be merged with the complete knm matrix before
// any reverse gouy is done.
//
// This new coupling coefficient generated is a specific knm matrix that applies
// to any carrier to signal sideband coupling on reflection for this mirror
switch(options.sparse_solver){
case KLU_FULL:
if(inter.num_signals){
int i;
for(i=0; i < inter.num_signals; i++){
signal_t *sig = &inter.signal_list[i];
// check if this is affecting this mirror
if((sig->type == SIG_X || sig->type == SIG_Y)
&& sig->component_type == MIRROR
&& &inter.mirror_list[sig->component_index] == mirror){
int n_gnd_n1 = !inter.node_list[*sig->node1_index].gnd_node;
int n_gnd_n2 = !inter.node_list[*sig->node2_index].gnd_node;
// ensure that we have at least 1 non-dumped node
assert(n_gnd_n1 || n_gnd_n2);
// ensure we have somewhere to store the results
if(n_gnd_n1) assert(sig->knm_tilt_11 != NULL);
if(n_gnd_n2) assert(sig->knm_tilt_22 != NULL);
complex_t X_bar_11 = complex_0, X_bar_22 = complex_0;
complex_t q1, q2;
if(sig->type == SIG_X){
q1 = knm_q.qxt2_11;
q2 = knm_q.qxt2_22;
}else{
q1 = knm_q.qyt2_11;
q2 = knm_q.qyt2_22;
}
// now we compute the \bar{X} variable from Bayer-Helms ensuring that we use the correct q value
// depending on direction and signal type. We always assume this knm matrix represents a mode matched
// case (as one of the other solvers above will handle that) and the beam basis is q1.
if(n_gnd_n1)
X_bar_11 = z_by_x(co(q1.re, q1.im), -2.0/w0_size(q1, *inter.node_list[*sig->node1_index].n));
//X_bar_11 = z_by_x(cconj(X_bar_11), -1);
if(n_gnd_n2)
X_bar_22 = z_by_x(cconj(q2), -2.0/w0_size(q2, *inter.node_list[*sig->node2_index].n));
if(sig->type == SIG_Y){
// when the fsig is vertical the apparent sign at the back surface is reversed
X_bar_22 = z_by_ph(X_bar_11, 180);
}
int l, l1, l2, turn;
for (n = 0; n < inter.num_fields; n++) {
get_tem_modes_from_field_index(&n1, &m1, n);
for (m = 0; m < inter.num_fields; m++) {
get_tem_modes_from_field_index(&n2, &m2, m);
sig->knm_tilt_11[n][m] = complex_0;
sig->knm_tilt_22[n][m] = complex_0;
// no do the matrix multiplication between the signal knm and all the other merged knm
for (l = 0; l < inter.num_fields; l++){
get_tem_modes_from_field_index(&l1, &l2, l);
// DB: As per usual -1 signs are causing issues. Using turnit here on just the signal knm matrix.
// this seems counter intuitive to me as we then later apply turnit to the whole merged knm matrix.
// Without this the sidebands to not overlap with the reflected field properly
// As X_bar is linear in terms of misalignment my original thinking was the the angle was incorrect
// however inverting X_bar doesn't fix the issue.
turn = turnit(n2);
if(n_gnd_n1)
sig->knm_tilt_11[n][m] = z_pl_z(sig->knm_tilt_11[n][m],
z_by_z( z_by_x(knm_tilt_sig(sig->type, X_bar_11, n1, m1, l1, l2), turn),
mirror->knm.k11[l][m]));
if(n_gnd_n2)
sig->knm_tilt_22[n][m] = z_pl_z(sig->knm_tilt_22[n][m],
z_by_z( z_by_x(knm_tilt_sig(sig->type, X_bar_22, n1, m1, l1, l2), turn),
mirror->knm.k22[l][m]));
}
}
}
for (n = 0; n < inter.num_fields; n++) {
get_tem_modes_from_field_index(&n1, &m1, n);
for (m = 0; m < inter.num_fields; m++) {
get_tem_modes_from_field_index(&n2, &m2, m);
sig->knm_tilt_11[n][m] = rev_gouy(sig->knm_tilt_11[n][m], n1, m1, n2, m2, knm_q.qxt1_11, knm_q.qxt2_11, knm_q.qyt1_11, knm_q.qyt2_11);
}
}
}
}
}
case KLU:
// old separate frequency solver applies the tilt fsig differently
// so don't bother with the above computation
break;
default:
bug_error("sparse solver not handled");
}
// Here we adjust the odd reflected horizontal modes. We do this because on
// reflection, just like in a mirror, the horizontal direction is flipped
// left to right. We also reverse the extra gouy phase present and rescale the
// phase.
for (n = 0; n < num_fields; n++) {
for (m = 0; m < num_fields; m++) {
get_tem_modes_from_field_index(&n1, &m1, n);
for (n = 0; n < inter.num_fields; n++) {
get_tem_modes_from_field_index(&n1, &m1, n);
for (m = 0; m < inter.num_fields; m++) {
get_tem_modes_from_field_index(&n2, &m2, m);
// 1) the old map code had wrong qx1/qx2 for k12/k21 at this place and I assume
// this was copied over. Fixed this now.
// 2) the old code uses the `turned' q's to compute thre reverse gouy, so
......@@ -1064,7 +1194,6 @@ int set_k_mirror(int mirror_index) {
mirror->knm.k12[n][m] = rev_gouy(mirror->knm.k12[n][m], n1, m1, n2, m2, knm_q.qxt1_12, knm_q.qxt2_12, knm_q.qyt1_12, knm_q.qyt2_12);
mirror->knm.k21[n][m] = rev_gouy(mirror->knm.k21[n][m], n1, m1, n2, m2, knm_q.qxt1_21, knm_q.qxt2_21, knm_q.qyt1_21, knm_q.qyt2_21);
mirror->knm.k22[n][m] = rev_gouy(mirror->knm.k22[n][m], n1, m1, n2, m2, knm_q.qxt1_22, knm_q.qxt2_22, knm_q.qyt1_22, knm_q.qyt2_22);
}
}
......@@ -1083,8 +1212,8 @@ int set_k_mirror(int mirror_index) {
printf(" when a 1,0 beam is incident\n");
}
for (n = 0; n < num_fields; n++) {
for (m = 0; m < num_fields; m++) {
for (n = 0; n < inter.num_fields; n++) {
for (m = 0; m < inter.num_fields; m++) {
get_tem_modes_from_field_index(&n1, &m1, n);
get_tem_modes_from_field_index(&n2, &m2, m);
if (inter.set_tem_phase_zero & 1) {
......@@ -1093,6 +1222,7 @@ int set_k_mirror(int mirror_index) {
mirror->knm.k21[n][m] = z_by_phr(mirror->knm.k21[n][m], -p21);
mirror->knm.k22[n][m] = z_by_phr(mirror->knm.k22[n][m], -p22);
}
// check if we need to flip the left and right, like looking in a mirror
turn = turnit(n2);
......@@ -2582,7 +2712,7 @@ void mode_match(complex_t q1, complex_t q2, complex_t *k, double *km) {
void set_k_all_components(bool rebuilding) {
int initonly, noinit;
// ddb - not sure what these variables are for, they don't seem to be used anywhere?
// mode mismatch coefficients: TODO make use of them somewhere or remove.
int mm = 0;
int mbs = 0;
int ms = 0;
......@@ -2738,6 +2868,13 @@ void set_k_all_components(bool rebuilding) {
fclose(fp_debug);
#endif
// TODO remove this later, if variables stay unused. For the moment:
// silence compiler warning
(void) mm;
(void) mbs;
(void) ms;
(void) ml;
}
//! Set up an ABCD mirror
......@@ -2986,7 +3123,7 @@ void set_ABCD_beamsplitter(int bs_index) {
bs->qqt1s = bs->qqt2s = Unity;
} else {
bs->qqt1s = bs->qqt2s =
make_ABCD(1.0, 0.0, coco / (bs->Rcy * co1 * co2), 1.0);
make_ABCD(1.0, 0.0, coco / (bs->Rcy), 1.0); // adf 31/10/13 removed wrong denomnator for C element, bug 128
}
}
......
This diff is collapsed.
......@@ -30,6 +30,24 @@
#ifndef KAT_AUX_H
#define KAT_AUX_H
#include "kat_matrix_ccs.h"
int startTimer(const char* name);
void endTimer(int id);
void closeTimerFile();
void add_carrier_frequency(const char *name, double f, frequency_t **freq);
void add_sideband_frequency(const char *name, frequency_t **freq, frequency_t *cfreq, double *fmod, int type, int order);
void add_user_frequency(const char *name, double f);
void print_frequency_couplings(const char *name, int num_fs, int **does_f_couple, int **f_couple_order);
void print_used_frequency_list();
void update_frequency_coupling(int allocing);
void update_frequency_list();
void fill_frequency_linked_list();
void reduce_frequency_linked_list();
void get_path_io(const char* input, char* output, bool unixStyle);
const char* get_path_i(const char* input, bool unixStyle);
int system_call(const char* command);
......@@ -68,7 +86,8 @@ void dupdump(void); //!< Dump duplicate string
char *duplicate_string(const char *s);
char *duplicate_to_longer_string(const char *s, int n);
int get_node_index_for(const char *node_name);
int update_node_index_for(const char *node_name);
int update_node_index_for(const char *node_name, int direction);
void connect_component_to_node(int node_idx, void *comp, int type);
int get_reduced_index_for(int node_index);
int get_overall_component_index(int type, int component_index);
int get_function(double **function, const char *input_string);
......@@ -84,7 +103,7 @@ int get_detector_or_node_index_from_name(const char *s);
char *get_detector_name(const int i);
int ctoi(char c, int *i);
int my_atoi(char *s, int *i);
bool atod(char *s, double *d);
bool atod(const char *s, double *d);
char *complex_form(const complex_t z);
char *complex_form15(const complex_t z);
char *freq_form(double f);
......@@ -97,6 +116,8 @@ complex_t my_cpow(complex_t z, double x);
complex_t my_cexp(complex_t z);
complex_t my_clog(complex_t z);
complex_t pow_complex(complex_t z, int nom, int denom);
complex_t pow_complex_i(int k);
int pow_neg_1(int n);
double zeroin(double ax, double bx, double (*f) (double), double tol);
bool string_matches(char *input_string, char *match_string);
bool string_matches_exactly(char *input_string, char *match_string);
......
This diff is collapsed.
......@@ -30,6 +30,11 @@
#ifndef KAT_CALC_H
#define KAT_CALC_H
#include "kat_matrix_ccs.h"
complex_t calc_mech_tf(mech_transfer_func_t *mtf, complex_t s);
complex_t knm_tilt_sig(int sig_type, complex_t X_bar, int n1, int m1, int n2, int m2);
void get_xaxis_values(axis_t *axis, double *dx, double *x_min, double *x_max, int round);
void compute_functions(void);
void compute_puts(void);
void signals_rhs(double f, double f1, int carrier, int lower2,
......@@ -42,7 +47,8 @@ void fill_signals(void);
void x12_out(void);
void x3_out(void);
void x0_out(void);
void store_solution(double frequency, int frequency_index, int field_type);
void store_solution_old(double frequency, int frequency_index, int field_type);
void store_solution_new();
double get_classical_power(int detector_index);
int create_mix_table(int num_demod, double fmix[MAX_MIX + 1][MAX_DEMOD + 1]);
complex_t set_demodulation_phase(
......@@ -69,8 +75,9 @@ void rebuild_all(void);
void tune_parameters(void);
void create_data_array(complex_t *sol);
void compute_result(complex_t *z_tmp);
complex_t xyamp(node_t sig_node, complex_t q);
void data_point(void);
complex_t xyamp(node_t *sig_node, complex_t q);
void data_point_old(void);
void data_point_new(void);
void process_modulation_sidebands(double f1);
void solve_signal_sidebands(double f2, int field_type,
int modulator_index, int modulation_order_index,
......@@ -78,7 +85,7 @@ void solve_signal_sidebands(double f2, int field_type,
void fill_detectors(void);
complex_t beam_shape(int detector_index);
complex_t beam_convolution(int detector_index);
complex_t get_modulation_amplitude(int component_index, int order, int lower);
complex_t amplitude_detector(int k);
complex_t photo_detector0(int k);
complex_t photo_detector2(int k, int num_demod);
......@@ -140,6 +147,17 @@ complex_t get_qshot_noise_spectral_density(
light_out_t *light_output,
complex_t demod_amplitude);
void calc_mirror_signal_vars(signal_t *signal, mirror_t *mirror, double *factor, double *phase, double *ph1, double f, double f_c);
void calc_space_signal_vars(space_t *space, double *factor, double *ph1, double f_c, int order);
void calc_beamsplitter_signal_vars(beamsplitter_t *beamsplitter, double *factor, double *ph1, double f, double f_c);
complex_t calc_reflect_tilt_signal(signal_t *signal, complex_t **knm, int in, int out, complex_t X_bar);
void fill_mirror_signal_rhs(signal_t *signal, matrix_ccs_vars_t* M_car, matrix_ccs_vars_t* M_sig);
void fill_space_signal_rhs(signal_t *signal, matrix_ccs_vars_t* M_car, matrix_ccs_vars_t* M_sig);
void fill_bs_signal_rhs(signal_t *signal, matrix_ccs_vars_t* M_car, matrix_ccs_vars_t* M_sig);
void fill_modulator_signal_rhs(signal_t *signal, matrix_ccs_vars_t* M_car, matrix_ccs_vars_t* M_sig);
#endif // KAT_CALC_H
/*
......
......@@ -95,7 +95,7 @@ void _check_mirror_indices(mirror_t *mirror, indices_t *indices, int matrix_type
// don't assign to diagonal elements
assert(col_index_2 != row_index_1);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// make sure the index values are sensible
assert(base_index_1 >= 0);
assert(base_index_1 < inter.num_quantum_eqns);
......@@ -228,7 +228,7 @@ void _check_beamsplitter_indices(beamsplitter_t *bs, indices_t *indices,
assert(col_index_3 != row_index_4);
assert(col_index_4 != row_index_3);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the
// right range (namely 0 <= base_index_[1-4] < inter.num_quantum_eqns)
assert(base_index_1 >= 0);
......@@ -343,7 +343,7 @@ void _check_modulator_indices(modulator_t *modulator, indices_t *indices,
assert(col_index_1 != row_index_2);
assert(col_index_2 != row_index_1);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the
assert(base_index_1 >= 0);
assert(base_index_1 < inter.num_quantum_eqns);
......@@ -481,7 +481,7 @@ void _check_space_indices(space_t *space, indices_t *indices, int matrix_type) {
assert(col_index_1 != row_index_2);
assert(col_index_2 != row_index_1);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the
assert(base_index_1 >= 0);
assert(base_index_1 < inter.num_quantum_eqns);
......@@ -562,7 +562,7 @@ void _check_squeezer_indices(squeezer_t *squeezer, indices_t *indices,
assert(col_index_1 != row_index_2);
assert(col_index_2 != row_index_1);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the
assert(base_index_1 >= 0);
assert(base_index_1 < inter.num_quantum_eqns);
......@@ -642,7 +642,7 @@ void _check_lens_indices(lens_t *lens, indices_t *indices, int matrix_type) {
assert(col_index_1 != row_index_2);
assert(col_index_2 != row_index_1);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the
assert(base_index_1 >= 0);
assert(base_index_1 < inter.num_quantum_eqns);
......@@ -722,7 +722,7 @@ void _check_diode_indices(diode_t *diode, indices_t *indices, int matrix_type) {
assert(col_index_1 != row_index_2);
assert(col_index_2 != row_index_1);
}
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the
assert(base_index_1 >= 0);
assert(base_index_1 < inter.num_quantum_eqns);
......@@ -818,7 +818,7 @@ void _check_grating_indices(grating_t *grating, indices_t *indices,
// don't assign to diagonal elements
assert(col_index_1 != row_index_1);
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// check that we reset the non-used indices
assert(base_index_3 == 0);
assert(base_index_4 == 0);
......@@ -913,7 +913,7 @@ void _check_grating_indices(grating_t *grating, indices_t *indices,
// don't assign to diagonal elements
assert(col_index_3 != row_index_3);
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// check that we reset the non-used indices
assert(base_index_4 == 0);
assert(row_index_4 == 0);
......@@ -1023,7 +1023,7 @@ void _check_grating_indices(grating_t *grating, indices_t *indices,
// don't assign to diagonal elements
assert(col_index_3 != row_index_4);
assert(col_index_4 != row_index_3);
} else if (matrix_type == QCORR) {
} else if (matrix_type == SIGNAL_QCORR) {
// just to be really careful, check that the base indices are in the