sweeps
Sweeping tools.
run_sweep(params, sweep_params, metrics_func, fixed_kwargs=None, data=None, is_parallel=False, save_file=None, data_save_mode='end', return_errors=False)
Run a sweep over a single parameter, or multiple parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
params
|
dict
|
The base parameters to sweep over. |
required |
sweep_params
|
dict
|
The parameters to sweep over. key: The parameter name. value: The list of values to sweep over. |
required |
metrics_func
|
function
|
The function to evaluate the metrics. |
required |
fixed_params
|
dict
|
The fixed parameters to send into metrics_func. Defaults to None. |
required |
data
|
dict
|
The data to append to. Defaults to None. |
None
|
is_parallel
|
bool
|
Whether to sweep through the sweep_params lists in parallel or through their cartesian product. Defaults to False. |
False
|
save_file
|
str
|
The file to save the data to. Defaults to None, in which case data is saved to a temporary file, which will be deleted upon closing (e.g. during garbage collection). |
None
|
data_save_mode
|
str
|
The mode to save the data. Defaults to None. Options are: "no" - don't save data "end" - save data at the end of the sweep "during" - save data during and at the end of the sweep |
'end'
|
Returns: dict: The data after the sweep.
Source code in jaxquantum/devices/analysis/sweeps.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|