Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.17.0 #640

Merged
merged 17 commits into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,7 @@ jobs:
extra-packages: pytest
- name: Run the unit tests & generate coverage report
run: pytest --cov --cov-fail-under=100
- name: Test validation with legacy jsonschema
run: |
pip install jsonschema==4.17.3
pytest tests/test_abstract_repr.py
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.16.2
0.17.0
49 changes: 26 additions & 23 deletions docs/source/intro_rydberg_blockade.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@
"## Pulser's main features"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pulser\n",
"from pulser_simulation import QutipEmulator"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand All @@ -38,11 +50,8 @@
},
"outputs": [],
"source": [
"from pulser import Register\n",
"from pulser.devices import DigitalAnalogDevice\n",
"\n",
"layers = 3\n",
"reg = Register.hexagon(layers)\n",
"reg = pulser.Register.hexagon(layers)\n",
"reg.draw(with_labels=False)"
]
},
Expand Down Expand Up @@ -73,14 +82,11 @@
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"from pulser import Pulse\n",
"from pulser.waveforms import RampWaveform, BlackmanWaveform\n",
"\n",
"duration = 1000 # Typical: ~1 µsec\n",
"pulse = Pulse(\n",
" BlackmanWaveform(duration, np.pi), RampWaveform(duration, -5.0, 10.0), 0\n",
"pulse = pulser.Pulse(\n",
" amplitude=pulser.BlackmanWaveform(duration, np.pi),\n",
" detuning=pulser.RampWaveform(duration, -5.0, 10.0),\n",
" phase=0,\n",
")\n",
"pulse.draw()"
]
Expand All @@ -98,14 +104,14 @@
"metadata": {},
"outputs": [],
"source": [
"from pulser import Sequence\n",
"\n",
"reg = Register.rectangle(1, 2, spacing=8, prefix=\"atom\")\n",
"reg = pulser.Register.rectangle(1, 2, spacing=8, prefix=\"atom\")\n",
"reg.draw()\n",
"\n",
"pi_pulse = Pulse.ConstantDetuning(BlackmanWaveform(duration, np.pi), 0.0, 0.0)\n",
"pi_pulse = pulser.Pulse.ConstantDetuning(\n",
" pulser.BlackmanWaveform(duration, np.pi), 0.0, 0.0\n",
")\n",
"\n",
"seq = Sequence(reg, DigitalAnalogDevice)\n",
"seq = pulser.Sequence(reg, pulser.DigitalAnalogDevice)\n",
"\n",
"seq.declare_channel(\"ryd\", \"rydberg_local\", \"atom0\")\n",
"\n",
Expand Down Expand Up @@ -154,9 +160,6 @@
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"from pulser_simulation import QutipEmulator\n",
"\n",
"data = []\n",
"distances = np.linspace(6.5, 14, 7)\n",
"\n",
Expand All @@ -166,10 +169,10 @@
"\n",
"for i, R in enumerate(distances):\n",
" # Atom Register and Device\n",
" reg = Register.rectangle(1, 2, spacing=R, prefix=\"atom\")\n",
" reg = pulser.Register.rectangle(1, 2, spacing=R, prefix=\"atom\")\n",
"\n",
" # Pulse Sequence\n",
" seq = Sequence(reg, DigitalAnalogDevice)\n",
" seq = pulser.Sequence(reg, pulser.DigitalAnalogDevice)\n",
" seq.declare_channel(\"ryd\", \"rydberg_local\", \"atom0\")\n",
" seq.add(pi_pulse, \"ryd\")\n",
" seq.target(\"atom1\", \"ryd\")\n",
Expand Down Expand Up @@ -218,7 +221,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
Expand All @@ -232,7 +235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
"version": "3.10.12"
}
},
"nbformat": 4,
Expand Down
2 changes: 2 additions & 0 deletions pulser-core/MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ include LICENSE
include pulser/devices/interaction_coefficients/C6_coeffs.json
include pulser/json/abstract_repr/schemas/device-schema.json
include pulser/json/abstract_repr/schemas/sequence-schema.json
include pulser/json/abstract_repr/schemas/register-schema.json
include pulser/json/abstract_repr/schemas/layout-schema.json
53 changes: 51 additions & 2 deletions pulser-core/pulser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,58 @@

"""A pulse-level composer for neutral-atom quantum devices."""

from pulser._version import __version__
from pulser._version import __version__ as __version__
from pulser.waveforms import (
CompositeWaveform,
CustomWaveform,
ConstantWaveform,
RampWaveform,
BlackmanWaveform,
InterpolatedWaveform,
KaiserWaveform,
)
from pulser.pulse import Pulse
from pulser.register import Register, Register3D
from pulser.devices import AnalogDevice, DigitalAnalogDevice, MockDevice
from pulser.sequence import Sequence
from pulser.backend import (
EmulatorConfig,
NoiseModel,
QPUBackend,
)

from pulser.backend import QPUBackend # isort: skip
# Exposing relevant submodules
from pulser import (
waveforms as waveforms,
channels as channels,
register as register,
devices as devices,
sampler as sampler,
backend as backend,
)

__all__ = [
# pulser.waveforms
"CompositeWaveform",
"CustomWaveform",
"ConstantWaveform",
"RampWaveform",
"BlackmanWaveform",
"InterpolatedWaveform",
"KaiserWaveform",
# pulser.pulse
"Pulse",
# pulser.register
"Register",
"Register3D",
# pulser.devices
"AnalogDevice",
"DigitalAnalogDevice",
"MockDevice",
# pulser.sequence
"Sequence",
# pulser.backends
"EmulatorConfig",
"NoiseModel",
"QPUBackend",
]
2 changes: 2 additions & 0 deletions pulser-core/pulser/backend/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@
from pulser.backend.config import EmulatorConfig
from pulser.backend.noise_model import NoiseModel
from pulser.backend.qpu import QPUBackend

__all__ = ["EmulatorConfig", "NoiseModel", "QPUBackend"]
Loading
Loading