|
131 | 131 | "example_graph, example_register, example_pulse = compiled[64]\n", |
132 | 132 | "\n", |
133 | 133 | "# The molecule, as laid out on the Quantum Device.\n", |
134 | | - "example_register.draw(blockade_radius=pl.AnalogDevice.min_atom_distance + 0.01)\n", |
| 134 | + "example_register.draw()\n", |
135 | 135 | "\n", |
136 | 136 | "# The laser pulse used to control its state evolution.\n", |
137 | 137 | "example_pulse.draw()" |
|
143 | 143 | "source": [ |
144 | 144 | "## Experimenting with registers and pulses\n", |
145 | 145 | "\n", |
146 | | - "You can, of course, adopt different registers or pulses, using the underlying Pulser Framework." |
| 146 | + "You may experiment with different pulses, by passing arguments to `compile_pulse`." |
147 | 147 | ] |
148 | 148 | }, |
149 | 149 | { |
|
152 | 152 | "metadata": {}, |
153 | 153 | "outputs": [], |
154 | 154 | "source": [ |
155 | | - "import pulser\n", |
156 | | - "\n", |
157 | | - "example_register = pulser.Register({\"q0\": (0, 0)})\n", |
158 | | - "example_pulse = pulser.Pulse.ArbitraryPhase(\n", |
159 | | - " amplitude=pulser.waveforms.RampWaveform(duration=150, start=100, stop=300),\n", |
160 | | - " phase=pulser.waveforms.ConstantWaveform(duration=150, value=15),\n", |
161 | | - " post_phase_shift=5\n", |
162 | | - ")\n", |
163 | | - "\n", |
164 | | - "example_register.draw()\n", |
165 | | - "example_pulse.draw()" |
| 155 | + "example_pulse = graphs_to_compile[0].compile_pulse(normalized_amplitude=0.1, normalized_duration=0.1) # arbitrary values\n", |
| 156 | + "example_pulse.draw()\n" |
166 | 157 | ] |
167 | 158 | }, |
168 | 159 | { |
169 | 160 | "cell_type": "markdown", |
170 | 161 | "metadata": {}, |
171 | 162 | "source": [ |
172 | | - "For this, you'll probably want to take a look at [the documentation of Pulser](https://pulser.readthedocs.io/)." |
| 163 | + "You can experiment further, using arbitrary pulses and registers, but for this, you'll have to use the low-level Pulser framework, which goes beyond the scope of this tutorial. You may find further details on pulses and registers in [the documentation of Pulser](https://pulser.readthedocs.io/)." |
173 | 164 | ] |
174 | 165 | }, |
175 | 166 | { |
|
189 | 180 | "outputs": [], |
190 | 181 | "source": [ |
191 | 182 | "from qek.data.processed_data import ProcessedData\n", |
192 | | - "from qek.backends import QutipBackend\n", |
| 183 | + "from qek.target.backends import QutipBackend\n", |
193 | 184 | "\n", |
194 | 185 | "# In this tutorial, to make things faster, we'll only run the graphs that require 5 qubits or less.\n", |
195 | 186 | "# If you wish to run more entries, feel free to increase this value.\n", |
|
203 | 194 | "processed_dataset = []\n", |
204 | 195 | "backend = QutipBackend(device=pl.AnalogDevice)\n", |
205 | 196 | "for graph, register, pulse in tqdm(compiled):\n", |
206 | | - " if len(register.qubits) > MAX_QUBITS:\n", |
| 197 | + " if len(register) > MAX_QUBITS:\n", |
207 | 198 | " continue\n", |
208 | 199 | " states = await backend.run(register=register, pulse=pulse)\n", |
209 | | - " processed_dataset.append(ProcessedData.from_register(register=register, pulse=pulse, device=pl.AnalogDevice, state_dict=states, target=graph.target))" |
| 200 | + " processed_dataset.append(ProcessedData.custom(register=register, pulse=pulse, device=pl.AnalogDevice, state_dict=states, target=graph.target))" |
210 | 201 | ] |
211 | 202 | }, |
212 | 203 | { |
|
241 | 232 | "HAVE_PASQAL_ACCOUNT = False # If you have a PASQAL Cloud account, fill in the details and set this to `True`.\n", |
242 | 233 | "\n", |
243 | 234 | "if HAVE_PASQAL_ACCOUNT: \n", |
244 | | - " from qek.backends import RemoteQPUBackend\n", |
| 235 | + " from qek.target.backends import RemoteQPUBackend\n", |
245 | 236 | " processed_dataset = []\n", |
246 | 237 | "\n", |
247 | 238 | " # Initialize connection\n", |
|
281 | 272 | "\n", |
282 | 273 | " # Send the work to the QPU and await the result\n", |
283 | 274 | " states = await backend.run(register=register, pulse=pulse)\n", |
284 | | - " processed_dataset.append(ProcessedData.from_register(register=register, pulse=pulse, device=device, state_dict=states, target=graph.target))" |
| 275 | + " processed_dataset.append(ProcessedData.custom(register=register, pulse=pulse, device=device, state_dict=states, target=graph.target))" |
285 | 276 | ] |
286 | 277 | }, |
287 | 278 | { |
|
0 commit comments