app: multi-core-inverter: allow setting coupling and drive conductivities separately
This commit is contained in:
@@ -100,7 +100,8 @@ struct Params {
|
|||||||
input_magnitude: f32,
|
input_magnitude: f32,
|
||||||
clock_phase_duration: f32,
|
clock_phase_duration: f32,
|
||||||
clock_decay: f32, // exp decay half-life
|
clock_decay: f32, // exp decay half-life
|
||||||
conductivity: f32, // wire conductivity
|
ctl_conductivity: f32,
|
||||||
|
coupling_conductivity: f32,
|
||||||
// 's' = core (ferromagnetic part)
|
// 's' = core (ferromagnetic part)
|
||||||
s_major: f32,
|
s_major: f32,
|
||||||
s_minor: f32,
|
s_minor: f32,
|
||||||
@@ -179,8 +180,12 @@ impl Params {
|
|||||||
self.clock_decay = p;
|
self.clock_decay = p;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
fn with_conductivity(mut self, p: f32) -> Self {
|
fn with_ctl_conductivity(mut self, p: f32) -> Self {
|
||||||
self.conductivity = p;
|
self.ctl_conductivity = p;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
fn with_coupling_conductivity(mut self, p: f32) -> Self {
|
||||||
|
self.coupling_conductivity = p;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -278,7 +283,8 @@ fn main() {
|
|||||||
input_magnitude: 0.0,
|
input_magnitude: 0.0,
|
||||||
clock_phase_duration: 0.0,
|
clock_phase_duration: 0.0,
|
||||||
clock_decay: 0.0,
|
clock_decay: 0.0,
|
||||||
conductivity: 0.0,
|
ctl_conductivity: 0.0,
|
||||||
|
coupling_conductivity: 0.0,
|
||||||
// 's' = core (ferromagnetic part)
|
// 's' = core (ferromagnetic part)
|
||||||
s_major: um(160),
|
s_major: um(160),
|
||||||
s_minor: um(30),
|
s_minor: um(30),
|
||||||
@@ -301,7 +307,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(160000))
|
.with_clock_phase_duration(ps(160000))
|
||||||
.with_clock_decay(ps(12000))
|
.with_clock_decay(ps(12000))
|
||||||
.with_input_magnitude(2.0e7)
|
.with_input_magnitude(2.0e7)
|
||||||
.with_conductivity(1e6)
|
.with_ctl_conductivity(1e6)
|
||||||
|
.with_coupling_conductivity(1e6)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"33-160ns-12000ps-1e7A",
|
"33-160ns-12000ps-1e7A",
|
||||||
@@ -310,7 +317,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(160000))
|
.with_clock_phase_duration(ps(160000))
|
||||||
.with_clock_decay(ps(12000))
|
.with_clock_decay(ps(12000))
|
||||||
.with_input_magnitude(1.0e7)
|
.with_input_magnitude(1.0e7)
|
||||||
.with_conductivity(1e6)
|
.with_ctl_conductivity(1e6)
|
||||||
|
.with_coupling_conductivity(1e6)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"34-320ns-12000ps-1e7A",
|
"34-320ns-12000ps-1e7A",
|
||||||
@@ -319,7 +327,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(320000))
|
.with_clock_phase_duration(ps(320000))
|
||||||
.with_clock_decay(ps(12000))
|
.with_clock_decay(ps(12000))
|
||||||
.with_input_magnitude(1.0e7)
|
.with_input_magnitude(1.0e7)
|
||||||
.with_conductivity(1e6)
|
.with_ctl_conductivity(1e6)
|
||||||
|
.with_coupling_conductivity(1e6)
|
||||||
);
|
);
|
||||||
let deferred = || run_sim(
|
let deferred = || run_sim(
|
||||||
"35-320ns-24000ps-1e7A",
|
"35-320ns-24000ps-1e7A",
|
||||||
@@ -328,7 +337,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(320000))
|
.with_clock_phase_duration(ps(320000))
|
||||||
.with_clock_decay(ps(24000))
|
.with_clock_decay(ps(24000))
|
||||||
.with_input_magnitude(1.0e7)
|
.with_input_magnitude(1.0e7)
|
||||||
.with_conductivity(1e6)
|
.with_ctl_conductivity(1e6)
|
||||||
|
.with_coupling_conductivity(1e6)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"36-40ns-4000ps-1e7A-1e5cond",
|
"36-40ns-4000ps-1e7A-1e5cond",
|
||||||
@@ -337,7 +347,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(1.0e7)
|
.with_input_magnitude(1.0e7)
|
||||||
.with_conductivity(1e5)
|
.with_ctl_conductivity(1e5)
|
||||||
|
.with_coupling_conductivity(1e5)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"37-40ns-4000ps-5e8A-1e5cond",
|
"37-40ns-4000ps-5e8A-1e5cond",
|
||||||
@@ -346,7 +357,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(5e8)
|
.with_input_magnitude(5e8)
|
||||||
.with_conductivity(1e5)
|
.with_ctl_conductivity(1e5)
|
||||||
|
.with_coupling_conductivity(1e5)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"38-40ns-4000ps-2e8A-1e5cond",
|
"38-40ns-4000ps-2e8A-1e5cond",
|
||||||
@@ -355,7 +367,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(2e8)
|
.with_input_magnitude(2e8)
|
||||||
.with_conductivity(1e5)
|
.with_ctl_conductivity(1e5)
|
||||||
|
.with_coupling_conductivity(1e5)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"39-40ns-4000ps-2e9A-1e4cond",
|
"39-40ns-4000ps-2e9A-1e4cond",
|
||||||
@@ -364,7 +377,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(2e9)
|
.with_input_magnitude(2e9)
|
||||||
.with_conductivity(1e4)
|
.with_ctl_conductivity(1e4)
|
||||||
|
.with_coupling_conductivity(1e4)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"40-40ns-4000ps-2e10A-1e3cond",
|
"40-40ns-4000ps-2e10A-1e3cond",
|
||||||
@@ -373,7 +387,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(2e10)
|
.with_input_magnitude(2e10)
|
||||||
.with_conductivity(1e3)
|
.with_ctl_conductivity(1e3)
|
||||||
|
.with_coupling_conductivity(1e3)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"41-40ns-4000ps-2e6A-1e7cond",
|
"41-40ns-4000ps-2e6A-1e7cond",
|
||||||
@@ -382,7 +397,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(2e6)
|
.with_input_magnitude(2e6)
|
||||||
.with_conductivity(1e7)
|
.with_ctl_conductivity(1e7)
|
||||||
|
.with_coupling_conductivity(1e7)
|
||||||
);
|
);
|
||||||
run_sim(
|
run_sim(
|
||||||
"42-40ns-4000ps-2e5A-1e8cond",
|
"42-40ns-4000ps-2e5A-1e8cond",
|
||||||
@@ -391,7 +407,8 @@ fn main() {
|
|||||||
.with_clock_phase_duration(ps(40000))
|
.with_clock_phase_duration(ps(40000))
|
||||||
.with_clock_decay(ps(4000))
|
.with_clock_decay(ps(4000))
|
||||||
.with_input_magnitude(2e5)
|
.with_input_magnitude(2e5)
|
||||||
.with_conductivity(1e8)
|
.with_ctl_conductivity(1e8)
|
||||||
|
.with_coupling_conductivity(1e8)
|
||||||
);
|
);
|
||||||
|
|
||||||
deferred();
|
deferred();
|
||||||
@@ -431,8 +448,8 @@ fn run_sim<const C: usize, const R: usize>(
|
|||||||
assert_eq!(stim.len(), num_cores as usize);
|
assert_eq!(stim.len(), num_cores as usize);
|
||||||
|
|
||||||
|
|
||||||
let wire_mat = IsomorphicConductor::new(params.conductivity.cast::<R>());
|
let ctl_mat = IsomorphicConductor::new(params.ctl_conductivity.cast::<R>());
|
||||||
// let ferro_mat = wire_mat;
|
let coupling_mat = IsomorphicConductor::new(params.coupling_conductivity.cast::<R>());
|
||||||
let ferro_mat = Ferroxcube3R1MH::new();
|
let ferro_mat = Ferroxcube3R1MH::new();
|
||||||
|
|
||||||
let last_core = num_cores - 1;
|
let last_core = num_cores - 1;
|
||||||
@@ -443,13 +460,13 @@ fn run_sim<const C: usize, const R: usize>(
|
|||||||
driver.add_classical_boundary(sim_padding);
|
driver.add_classical_boundary(sim_padding);
|
||||||
|
|
||||||
//////// create the wires and toroids
|
//////// create the wires and toroids
|
||||||
driver.fill_region(¶ms.input0(), wire_mat);
|
driver.fill_region(¶ms.input0(), coupling_mat);
|
||||||
driver.fill_region(¶ms.sense(last_core), wire_mat);
|
driver.fill_region(¶ms.sense(last_core), coupling_mat);
|
||||||
for core in 0..num_cores {
|
for core in 0..num_cores {
|
||||||
driver.fill_region(¶ms.s(core), ferro_mat);
|
driver.fill_region(¶ms.s(core), ferro_mat);
|
||||||
driver.fill_region(¶ms.ctl(core), wire_mat);
|
driver.fill_region(¶ms.ctl(core), ctl_mat);
|
||||||
if core != last_core {
|
if core != last_core {
|
||||||
driver.fill_region(¶ms.coupling(core), wire_mat);
|
driver.fill_region(¶ms.coupling(core), coupling_mat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user