Rydberg
This simulates the operation of a Rydberg tweezer array, i.e. a line of qubit that might be entangled through a Rydberg blockade. It can be deployed on qlued as described on their documentation. Below you can find the API of the simulator.
Config
In this module we define all the configuration parameters for the Rydberg package.
No simulation is performed here. The entire logic is implemented in the spooler.py
module.
BarrierInstruction
Bases: BaseModel
The barrier instruction. As each instruction it requires the
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['barrier']
|
The string to identify the instruction |
wires |
Annotated[List[Annotated[int, Field(ge=0, le=N_MAX_WIRES - 1)]], Field(min_length=0, max_length=N_MAX_WIRES)]
|
The wires on which the instruction should be applied so the indices should be between 0 and NUM_WIRES-1 |
params |
Annotated[List[float], Field(max_length=0)]
|
has to be empty |
Source code in rydberg/config.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
|
MeasureInstruction
Bases: BaseModel
The measure instruction.
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['measure']
|
How to identify the instruction |
wires |
Annotated[List[Annotated[int, Field(ge=0, le=N_MAX_WIRES - 1)]], Field(min_length=1, max_length=1)]
|
Exactly one wire has to be given. |
params |
Annotated[List[float], Field(max_length=0)]
|
Has to be empty |
Source code in rydberg/config.py
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
|
RlxInstruction
Bases: GateInstruction
The rlx instruction. As each instruction it requires the following attributes
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['rlx']
|
The string to identify the instruction |
wires |
Annotated[List[Annotated[int, Field(ge=0, le=N_MAX_WIRES - 1)]], Field(min_length=1, max_length=1)]
|
The wire on which the instruction should be applied so the indices should be between 0 and N_MAX_WIRES-1 |
params |
Annotated[List[Annotated[float, Field(ge=0, le=2 * pi)]], Field(min_length=1, max_length=1)]
|
has to be empty |
Source code in rydberg/config.py
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 |
|
RlzInstruction
Bases: GateInstruction
The rlz instruction. As each instruction it requires the
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['rlz']
|
The string to identify the instruction |
wires |
Annotated[List[Annotated[int, Field(ge=0, le=N_MAX_WIRES - 1)]], Field(min_length=1, max_length=1)]
|
The wire on which the instruction should be applied so the indices should be between 0 and N_MAX_WIRES-1 |
params |
Annotated[List[Annotated[float, Field(ge=0, le=2 * pi)]], Field(min_length=1, max_length=1)]
|
has to be empty |
Source code in rydberg/config.py
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 |
|
RydbergBlockInstruction
Bases: GateInstruction
The Rydberg blockade instruction. As each instruction it requires the
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['rydberg_block']
|
The string to identify the instruction |
wires |
Annotated[List[Annotated[int, Field(ge=0, le=N_MAX_WIRES - 1)]], Field(min_length=2, max_length=N_MAX_WIRES)]
|
The wire on which the instruction should be applied so the indices should be between 0 and N_MAX_WIRES-1 |
params |
Annotated[List[Annotated[float, Field(ge=0, le=2 * pi)]], Field(min_length=1, max_length=1)]
|
has to be empty |
Source code in rydberg/config.py
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 |
|
RydbergExperiment
Bases: BaseModel
The class that defines the Rydberg experiments. Each of those
RydbergExperiment
s is executed on a RydbergSpooler
.
Source code in rydberg/config.py
176 177 178 179 180 181 182 183 184 185 186 187 188 189 |
|
RydbergFullInstruction
Bases: GateInstruction
The time evolution under the global Hamiltonian. It does not allow for any local control.
Attributes:
Name | Type | Description |
---|---|---|
name |
Literal['rydberg_full']
|
The string to identify the instruction |
wires |
Annotated[List[Annotated[int, Field(ge=0, le=N_MAX_WIRES - 1)]], Field(min_length=2, max_length=N_MAX_WIRES)]
|
The wire on which the instruction should be applied so the indices should be between 0 and N_MAX_WIRES-1 |
params |
Annotated[List[Annotated[float, Field(ge=0, le=5000000.0 * pi)]], Field(min_length=3, max_length=3)]
|
Define the parameter for |
Source code in rydberg/config.py
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 |
|
Simulation code
The module that contains all the necessary logic for the Rydberg simulator.
It has to implement the code that is executed for all the instructions that we defined
in the config.py
file.
gen_circuit(exp_name, json_dict)
The function the creates the instructions for the circuit.
json_dict: The list of instructions for the specific run.
Source code in rydberg/spooler.py
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 168 169 170 171 172 173 174 175 176 177 178 179 180 |
|
op_at_wire(op, pos, dim_per_wire)
Applies an operation onto the wire and provides unitaries on the other wires. Basically this creates the nice tensor products.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
op |
matrix
|
The operation that should be applied. |
required |
pos |
int
|
The wire onto which the operation should be applied. |
required |
dim_per_wire |
int
|
What is the local Hilbert space of each wire. |
required |
Returns:
Type | Description |
---|---|
csc_matrix
|
The tensor product matrix. |
Source code in rydberg/spooler.py
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 |
|