Skip to content

Commit

Permalink
Merge pull request #182 from nwittler/test-quick-setup
Browse files Browse the repository at this point in the history
Improve quick setup and config consistency
  • Loading branch information
nwittler authored Mar 24, 2022
2 parents 82157b3 + 672afd8 commit 0c2a80a
Show file tree
Hide file tree
Showing 8 changed files with 823 additions and 204 deletions.
7 changes: 6 additions & 1 deletion c3/generator/devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ def asdict(self) -> Dict[str, Any]:
params[key] = item.asdict()
return {
"c3type": self.__class__.__name__,
"name": self.name,
"inputs": self.inputs,
"outputs": self.outputs,
"params": params,
Expand Down Expand Up @@ -723,6 +724,7 @@ def step_response_function(self, ts):


# Obsolete. Use HighpassExponential
@dev_reg_deco
class HighpassFilter(Device):
"""Introduce a highpass filter
Expand Down Expand Up @@ -975,7 +977,10 @@ def __init__(self, **props):
self.inputs = props.pop("inputs", 1)
self.outputs = props.pop("outputs", 1)
self.signal = None
self.params["offset_amp"] = props.pop("offset_amp")
if (
self.params["offset_amp"] is None
): # i.e. it was not set in the general params already
self.params["offset_amp"] = props.pop("offset_amp")

def process(self, instr, chan, signal):
"""Distort signal by adding noise."""
Expand Down
3 changes: 2 additions & 1 deletion c3/generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ def read_config(self, filepath: str) -> None:

def fromdict(self, cfg: dict) -> None:
for name, props in cfg["Devices"].items():
props["name"] = name
dev_type = props.pop("c3type")
if "name" not in props:
props["name"] = name
self.devices[name] = dev_lib[dev_type](**props)
self.chains = cfg["Chains"]
self.__check_signal_chains()
Expand Down
339 changes: 339 additions & 0 deletions test/noise_exp_1.hjson
Original file line number Diff line number Diff line change
@@ -0,0 +1,339 @@
{
instructions:
{
rx90p:
{
name: rx90p
targets: null
params:
{
use_t_before: false
}
_Instruction__options:
{
d1:
{
gauss: {}
carrier: {}
}
}
fixed_t_end: true
ideal:
{
__array__:
[
[
{
__complex__: (0.7071067811865475+0j)
}
{
__complex__: -0.7071067811865475j
}
]
[
{
__complex__: -0.7071067811865475j
}
{
__complex__: (0.7071067811865475+0j)
}
]
]
}
gate_length: 7e-09
drive_channels:
{
d1:
{
gauss:
{
name: gauss
c3type: Envelope
shape: gaussian_nonorm
params:
{
amp:
{
value: 0.5
min_val: 0.4
max_val: 0.6
unit: V
symbol: \alpha
}
delta:
{
value: -1.0
min_val: -5.0
max_val: 3.0
unit: ""
symbol: \alpha
}
freq_offset:
{
value: -53000000.0
min_val: -56000000.0
max_val: -52000000.0
unit: Hz 2pi
symbol: \alpha
}
xy_angle:
{
value: -4.440892098500626e-16
min_val: -1.5707963267948966
max_val: 7.853981633974483
unit: rad
symbol: \alpha
}
sigma:
{
value: 1.75e-09
min_val: 8.75e-10
max_val: 3.5e-09
unit: s
symbol: \alpha
}
t_final:
{
value: 7e-09
min_val: 3.5e-09
max_val: 1.05e-08
unit: s
symbol: \alpha
}
}
drag: false
}
carrier:
{
c3type: Carrier
params:
{
freq:
{
value: 5050000000.0
min_val: 4500000000.0
max_val: 6000000000.0
unit: Hz 2pi
symbol: \alpha
}
framechange:
{
value: 0.0
min_val: -3.141592653589793
max_val: 9.42477796076938
unit: rad
symbol: \alpha
}
}
name: carrier
}
}
}
}
}
model:
{
Qubits:
{
Q1:
{
c3type: Qubit
params:
{
freq:
{
value: 5000000000.0
min_val: 4995000000.0
max_val: 5005000000.0
unit: Hz 2pi
symbol: \alpha
}
anhar:
{
value: -210000000.0
min_val: -380000000.0
max_val: -120000000.00000003
unit: Hz 2pi
symbol: \alpha
}
t1:
{
value: 2.7e-05
min_val: 1e-06
max_val: 9e-05
unit: s
symbol: \alpha
}
t2star:
{
value: 3.900000000000106e-05
min_val: 1e-05
max_val: 0.09
unit: s
symbol: \alpha
}
temp:
{
value: 0.05
min_val: 0.0
max_val: 0.12
unit: K
symbol: \alpha
}
}
hilbert_dim: 3
}
}
Couplings:
{
d1:
{
c3type: Drive
params: {}
hamiltonian_func: x_drive
connected:
[
Q1
]
}
}
Tasks: {}
max_excitations: 0
}
generator:
{
Devices:
{
LO:
{
c3type: LO
name: lo
inputs: 0
outputs: 1
params: {}
resolution: 100000000000.0
}
AWG:
{
c3type: AWG
name: awg
inputs: 0
outputs: 1
params: {}
resolution: 2000000000.0
options: ""
}
DigitalToAnalog:
{
c3type: DigitalToAnalog
name: dac
inputs: 1
outputs: 1
params: {}
resolution: 100000000000.0
}
Response:
{
c3type: ResponseFFT
name: resp
inputs: 1
outputs: 1
params:
{
rise_time:
{
value: 3e-10
min_val: 5e-11
max_val: 6e-10
unit: s
symbol: \alpha
}
}
resolution: 100000000000.0
}
Mixer:
{
c3type: Mixer
name: mixer
inputs: 2
outputs: 1
params: {}
resolution: 0
}
DCOffset:
{
c3type: DC_Offset
name: dc_offset
inputs: 1
outputs: 1
params:
{
offset_amp:
{
value: 0.0
min_val: -0.2
max_val: 0.2
unit: V
symbol: \alpha
}
}
resolution: 100000000000.0
}
VoltsToHertz:
{
c3type: VoltsToHertz
name: v_to_hz
inputs: 1
outputs: 1
params:
{
V_to_Hz:
{
value: 1000000000.0
min_val: 900000000.0
max_val: 1100000000.0
unit: Hz/V
symbol: \alpha
}
}
resolution: 0
}
}
Chains:
{
d1:
{
LO: []
AWG: []
DigitalToAnalog:
[
AWG
]
Response:
[
DigitalToAnalog
]
Mixer:
[
LO
Response
]
DCOffset:
[
Mixer
]
VoltsToHertz:
[
DCOffset
]
}
}
}
options:
{
propagate_batch_size: null
use_control_fields: true
overwrite_propagators: true
stop_partial_propagator_gradient: true
}
}
Loading

0 comments on commit 0c2a80a

Please sign in to comment.