statements
measure
measure(
atoms: list[Atom], qubits: list[Qubit]
) -> ilist.IList[int, Any]
measure(
atoms: ilist.IList[Atom, NumAtoms], qubits: list[Qubit]
) -> ilist.IList[int, NumAtoms]
measure(
atoms: list[Atom], qubits: ilist.IList[Qubit, NumAtoms]
) -> ilist.IList[int, NumAtoms]
measure(
atoms: ilist.IList[Atom, NumAtoms],
qubits: ilist.IList[Qubit, NumAtoms],
) -> ilist.IList[int, NumAtoms]
measure(atoms, qubits) -> ilist.IList[int, Any]
Perform a destructive measurement on the specified atoms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
atoms | list[Atom] | IList[Atom, NumAtoms] | The atoms to be measured. | required |
qubits | list[Qubit] | IList[Qubit, NumAtoms] | The qubits associated with the atoms being measured. | required |
Returns:
Type | Description |
---|---|
IList[int, Any] | ilist.IList[int, NumAtoms | Any]: A list of measurement results, where each result corresponds to an atom. |
Source code in src/bloqade/shuttle/dialects/atom/_interface.py
133 134 135 136 137 138 139 140 141 142 143 144 145 |
|
move
move(
zone: grid.Grid, atoms: list[Atom]
) -> ilist.IList[Atom, Any]
move(
zone: grid.Grid, atoms: ilist.IList[Atom, NumAtoms]
) -> ilist.IList[Atom, NumAtoms]
move(zone, atoms) -> ilist.IList[Atom, Any]
Create new atoms in the specified zone with the given qubits. Note that the specific locations of the atoms will be determined by the compiler.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zone | Grid | The grid zone where to move the atoms. | required |
atoms | list[Atom] | IList[Atom, NumQubits] | The atoms to be moved. | required |
Returns:
Type | Description |
---|---|
IList[Atom, Any] | ilist.IList[Atom, NumQubits | Any]: A list of newly created atoms. |
Source code in src/bloqade/shuttle/dialects/atom/_interface.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|
move_next_to
move_next_to(
zone: grid.Grid[Any, Any],
ctrls: list[Atom],
qargs: list[Atom],
) -> tuple[
ilist.IList[Atom, NumAtoms], ilist.IList[Atom, NumAtoms]
]
move_next_to(
zone: grid.Grid[Any, Any],
ctrls: ilist.IList[Atom, NumAtoms],
qargs: list[Atom],
) -> tuple[
ilist.IList[Atom, NumAtoms], ilist.IList[Atom, NumAtoms]
]
move_next_to(
zone: grid.Grid[Any, Any],
ctrls: list[Atom],
qargs: ilist.IList[Atom, NumAtoms],
) -> tuple[
ilist.IList[Atom, NumAtoms], ilist.IList[Atom, NumAtoms]
]
move_next_to(
zone: grid.Grid[Any, Any],
ctrls: ilist.IList[Atom, NumAtoms],
qargs: ilist.IList[Atom, NumAtoms],
) -> tuple[
ilist.IList[Atom, NumAtoms], ilist.IList[Atom, NumAtoms]
]
move_next_to(zone, ctrls, qargs)
Apply an operation to the specified atoms, optionally moving them in the process if the gate operation requires it. After the operation, the atoms potentially change their positions which will be reflected in the returned list.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zone | Grid[Any, Any] | The grid zone where the atoms are located. | required |
ctrls | list[Atom] | IList[Atom, NumAtoms] | The control atoms for the operation. | required |
qargs | list[Atom] | IList[Atom, NumAtoms] | The target atoms for the operation. | required |
Returns:
Type | Description |
---|---|
tuple[ilist.IList[Atom, NumAtoms], ilist.IList[Atom, NumAtoms]]: A tuple containing two lists of atoms: the control atoms and the target atoms after the operation. the first list contains the updated ctrls, and the second list contains the updated qargs. |
Source code in src/bloqade/shuttle/dialects/atom/_interface.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
|
new
new(
zone: grid.Grid, qubits: list[Qubit]
) -> ilist.IList[Atom, Any]
new(
zone: grid.Grid, qubits: ilist.IList[Qubit, NumQubits]
) -> ilist.IList[Atom, NumQubits]
new(zone, qubits)
Create new atoms in the specified zone with the given qubits.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
zone | Grid | The grid zone where atoms will be created. | required |
qubits | list[Qubit] | IList[Qubit, NumQubits] | The qubits associated with the new atoms. | required |
Returns:
Type | Description |
---|---|
ilist.IList[Atom, NumQubits | Any]: A list of newly created atoms. |
Source code in src/bloqade/shuttle/dialects/atom/_interface.py
20 21 22 23 24 25 26 27 28 29 30 31 32 |
|
reset_position
reset_position(
atoms: list[Atom], qubits: list[Qubit]
) -> None
reset_position(
atoms: list[Atom], qubits: ilist.IList[Qubit, NumAtoms]
) -> None
reset_position(
atoms: ilist.IList[Atom, NumAtoms], qubits: list[Qubit]
) -> None
reset_position(
atoms: ilist.IList[Atom, NumAtoms],
qubits: ilist.IList[Qubit, NumAtoms],
) -> None
reset_position(atoms, qubits) -> None
Reset the position of atoms to their initial state, terminating the moves.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
atoms | list[Atom] | IList[Atom, NumAtoms] | The atoms whose positions will be reset. | required |
qubits | list[Qubit] | IList[Qubit, NumAtoms] | The qubits associated with the atoms being reset. | required |
Source code in src/bloqade/shuttle/dialects/atom/_interface.py
107 108 109 110 111 112 113 114 115 116 |
|