Index
analyze_channels ¶
- Scan channels
This pass checks to make sure that: * There is no hyperfine coupling in the sequence * There are no non-uniform spatial modulation for rabi phase and amplitude * there is no more than one non-uniform spatial modulation for detuning
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit | AnalogCircuit | AnalogCircuit to analyze | required |
Returns:
Name | Type | Description |
---|---|---|
level_couplings | Dict | Dictionary containing the required channels for the sequence. Note that this will insert a uniform field for any missing channels. |
Raises:
Type | Description |
---|---|
ValueError | If there is hyperfine coupling in the sequence. |
ValueError | If there is more than one non-uniform spatial modulation for detuning. |
ValueError | If there are non-uniform spatial modulations for rabi phase and amplitude. |
Source code in src/bloqade/compiler/passes/hardware/define.py
assign_circuit ¶
- Assign variables and validate assignment
This pass assigns variables to the circuit and validates that all variables have been assigned.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit | AnalogCircuit | AnalogCircuit to assign variables to | required |
assignments | Dict[str, ParamType] | Dictionary containing the assignments for the variables in the circuit. | required |
Returns:
Name | Type | Description |
---|---|---|
assigned_circuit | Tuple[AnalogCircuit, Dict] | AnalogCircuit with variables assigned. |
Raises:
Type | Description |
---|---|
ValueError | If there are any variables that have not been assigned. |
Source code in src/bloqade/compiler/passes/hardware/define.py
canonicalize_circuit ¶
- Insert zero waveform in the explicit time intervals missing a waveform
This pass inserts a zero waveform in the explicit time intervals missing a waveform. This is required for later analysis passes to check that the waveforms are compatible with the hardware.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit | AnalogCircuit | AnalogCircuit to add padding to | required |
level_couplings | Dict | Dictionary containing the given channels for the sequence. | required |
Return circuit: AnalogCircuit with zero waveforms inserted in the explicit time intervals missing a waveform.
Source code in src/bloqade/compiler/passes/hardware/define.py
generate_ahs_code ¶
- generate ahs code
Generates the AHS code for the given circuit. This includes generating the lattice data, global detuning, global amplitude, global phase, local detuning and lattice site coefficients (if applicable).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
capabilities | QuEraCapabilities | None | Capabilities of the hardware. | required |
level_couplings | Dict | Dictionary containing the given channels for the sequence. | required |
circuit | AnalogCircuit | AnalogCircuit to generate AHS code for. | required |
Returns:
Name | Type | Description |
---|---|---|
ahs_components | AHSComponents | A collection of the AHS components generated for the given circuit. Can be used to generate the QuEra and Braket IR. |
Raises:
Type | Description |
---|---|
ValueError | If the capabilities are not provided but the circuit has a ParallelRegister. This is because the ParallelRegister requires the capabilities to generate the lattice data. |
Source code in src/bloqade/compiler/passes/hardware/define.py
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 |
|
generate_braket_ir ¶
- generate braket ir
This pass takes the AHS components and generates the Braket IR.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ahs_components | AHSComponents | A collection of the AHS components generated for the given circuit. | required |
shots | int | Number of shots to run the circuit for. | required |
Returns:
Name | Type | Description |
---|---|---|
task_specification | BraketTaskSpecification | Braket IR for the given circuit. |
Source code in src/bloqade/compiler/passes/hardware/define.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 |
|
generate_quera_ir ¶
- generate quera ir
This pass takes the AHS components and generates the QuEra IR.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ahs_components | AHSComponents | A collection of the AHS components generated for the given circuit. | required |
shots | int | Number of shots to run the circuit for. | required |
Returns:
Name | Type | Description |
---|---|---|
task_specification | QuEraTaskSpecification | QuEra IR for the given circuit. |
Source code in src/bloqade/compiler/passes/hardware/define.py
264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 |
|
validate_waveforms ¶
- validate piecewise linear and piecewise constant pieces of pulses
This pass check to make sure that the waveforms are compatible with the hardware. This includes checking that the waveforms are piecewise linear or piecewise constant. It also checks that the waveforms are compatible with the given channels.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
circuit | AnalogCircuit | AnalogCircuit to validate waveforms for | required |
level_couplings | Dict | Dictionary containing the given channels for the sequence. | required |
Raises:
Type | Description |
---|---|
ValueError | If the waveforms are not piecewise linear or piecewise constant, e.g. the waveform is not continuous. |
ValueError | If a waveform segment is not compatible with the given channels. |