Quantum Fog  0.9.3
C_SG_MAGNET_AMP_GEN.h
1 #pragma once
2 #include "C_AMP_GEN.h"
3 #include "SG_MAGNET.h"
4 class QB_NET;
5 class C_PI_WIND;
6 
7 
8  //notation: transition element < (n_neg, n_pos) | in_sum, in_row, in_spin>
9  //in_sum = the number of incoming particles.
10  //Only matrix elements with in_sum=1 are non-zero.
11  //in_row = when in_sum=1, the row of the in node with the particle.
12  //in_spin = when in_sum=1, the spin (+1 or -1) of the particle.
13  //The outgoing arrow has 2 occupation numbers: n_neg and n_pos
14  //All occupation numbers are either 0 or 1.
15  //States with n_neg + n_pos>1 are given zero amplitude.
16  //The outgoing states are (n-, n+) = (0, 0), (0, 1), (1, 0)
17 
18 
19 //******************************************
21 {
22 private:
23  DOUBLE its_magnetic_theta;//theta in degrees for magnet
24  DOUBLE its_magnetic_phi;//phi in degreees for magnet
25 
26  //these vectors are initially of zero length:
27  VECTOR<SHORT> its_spins;// 0 for -+, 1 for +, -1 for -; in 1-1 correspodence with its_in_nds
28  VECTOR<DOUBLE> its_thetas;// in degrees; in 1-1 correspodence with its_in_nds
29  VECTOR<DOUBLE> its_phis;// in degrees; in 1-1 correspodence with its_in_nds
30 public:
31  C_SG_MAGNET_AMP_GEN(SG_MAGNET * nd_p, QB_NET * net_p, C_PI_WIND * pi_wind_p);
33 
34  const DOUBLE & get_magnetic_theta() const;
35  const DOUBLE & get_magnetic_phi() const;
36  VOID set_magnetic_theta(const DOUBLE & theta);
37  VOID set_magnetic_phi(const DOUBLE & phi);
38 
39  SHORT get_spin(USHORT pos) const;
40  const DOUBLE & get_theta(USHORT pos) const;
41  const DOUBLE & get_phi(USHORT pos) const;
42 
43  VOID set_spin(USHORT pos, SHORT spin);
44  VOID set_theta(USHORT pos, const DOUBLE & theta);
45  VOID set_phi(USHORT pos, const DOUBLE & phi);
46 
47  const VECTOR<SHORT> & get_spins() const;
48  const VECTOR<DOUBLE> & get_thetas() const;
49  const VECTOR<DOUBLE> & get_phis() const;
50 
51  VOID set_spins(const VECTOR<SHORT> & spins);
52  VOID set_thetas(const VECTOR<DOUBLE> & thetas);
53  VOID set_phis(const VECTOR<DOUBLE> & phis);
54 
55  BOOLEAN param_vecs_are_empty();
56  VOID resize(USHORT len);
57  VOID resize(const VECTOR<USHORT> & in_nd_types);
58  VOID extract_at(USHORT loc);
59  VOID reorder(const UI_MAP & map);
60 
61  COMPLEX sg_magnet_amp(USHORT n_neg, USHORT n_pos, USHORT in_sum, USHORT in_row, SHORT in_spin);
62  USHORT get_expected_degen(const USHORT * in_sums, const USHORT * in_rows,const SHORT * in_spins);
63  BOOLEAN parents_are_canonical(VECTOR<USHORT> & in_nd_types);
64  BOOLEAN dialog_entries_are_legal(Str255 theta, Str255 phi);
65  VOID fill_trans_mat_and_st_names_of_nd();
66  BOOLEAN talk();
67 
68 
69 };
70 #pragma mark -
71 
72 //******************************************
73 inline
74 const DOUBLE & C_SG_MAGNET_AMP_GEN::get_magnetic_theta() const
75 {
76  return its_magnetic_theta;
77 }
78 //******************************************
79 inline
80 const DOUBLE & C_SG_MAGNET_AMP_GEN::get_magnetic_phi() const
81 {
82  return its_magnetic_phi;
83 }
84 //******************************************
85 inline
86 SHORT C_SG_MAGNET_AMP_GEN::get_spin(
87 USHORT pos) //in
88 const
89 {
90  return its_spins[pos];
91 }
92 //******************************************
93 inline
94 const DOUBLE & C_SG_MAGNET_AMP_GEN::get_theta(
95 USHORT pos) //in
96 const
97 {
98  return its_thetas[pos];
99 }
100 //******************************************
101 inline
102 const DOUBLE & C_SG_MAGNET_AMP_GEN::get_phi(
103 USHORT pos) //in
104 const
105 {
106  return its_phis[pos];
107 }
108 //******************************************
109 inline
110 VOID C_SG_MAGNET_AMP_GEN::set_spin(
111 USHORT pos, //in
112 SHORT spin) //in
113 {
114  its_spins[pos]=spin;
115 }
116 //******************************************
117 inline
118 VOID C_SG_MAGNET_AMP_GEN::set_theta(
119 USHORT pos, //in
120 const DOUBLE & theta) //in
121 {
122  its_thetas[pos]=theta;
123 }
124 //******************************************
125 inline
126 VOID C_SG_MAGNET_AMP_GEN::set_phi(
127 USHORT pos, //in
128 const DOUBLE & phi) //in
129 {
130  its_phis[pos]=phi;
131 }
132 //******************************************
133 inline
134 const VECTOR<SHORT> & C_SG_MAGNET_AMP_GEN::get_spins() const
135 {
136  return its_spins;
137 }
138 //******************************************
139 inline
140 const VECTOR<DOUBLE> & C_SG_MAGNET_AMP_GEN::get_thetas() const
141 {
142  return its_thetas;
143 }
144 //******************************************
145 inline
146 const VECTOR<DOUBLE> & C_SG_MAGNET_AMP_GEN::get_phis() const
147 {
148  return its_phis;
149 }
150 //******************************************
151 inline
152 VOID C_SG_MAGNET_AMP_GEN::set_spins(
153 const VECTOR<SHORT> & spins) //in
154 {
155  its_spins=spins;
156 }
157 //******************************************
158 inline
159 VOID C_SG_MAGNET_AMP_GEN::set_thetas(
160 const VECTOR<DOUBLE> & thetas) //in
161 {
162  its_thetas=thetas;
163 }
164 //******************************************
165 inline
166 VOID C_SG_MAGNET_AMP_GEN::set_phis(
167 const VECTOR<DOUBLE> & phis) //in
168 {
169  its_phis=phis;
170 }
171 //******************************************
172 inline
173 BOOLEAN C_SG_MAGNET_AMP_GEN::param_vecs_are_empty()
174 {
175  return its_spins.get_len()==0;
176 }
Definition: C_SG_MAGNET_AMP_GEN.h:20
Definition: QB_NET.h:34
Definition: SG_MAGNET.h:17
Definition: C_PI_WIND.h:18
Definition: C_AMP_GEN.h:10
Definition: UI_MAP.h:7