-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the classes for EOM mode configuration (#417)
* Creating the `pulser.channels` module * Create the EOM related classes * Splitting channels.py into two files * Comments for detuning_off UT * Documentation updates * Adding comments to the EOMConfig class
- Loading branch information
Showing
17 changed files
with
622 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2022 Pulser Development Team | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""The various hardware channel types.""" | ||
|
||
from pulser.channels.channels import Microwave, Raman, Rydberg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
# Copyright 2020 Pulser Development Team | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""The Channel subclasses.""" | ||
|
||
from __future__ import annotations | ||
|
||
from dataclasses import dataclass | ||
from typing import Optional | ||
|
||
from pulser.channels.base_channel import Channel, Literal | ||
from pulser.channels.eom import RydbergEOM | ||
|
||
|
||
@dataclass(init=True, repr=False, frozen=True) | ||
class Raman(Channel): | ||
"""Raman beam channel. | ||
Channel targeting the transition between the hyperfine ground states, in | ||
which the 'digital' basis is encoded. See base class. | ||
""" | ||
|
||
@property | ||
def basis(self) -> Literal["digital"]: | ||
"""The addressed basis name.""" | ||
return "digital" | ||
|
||
|
||
@dataclass(init=True, repr=False, frozen=True) | ||
class Rydberg(Channel): | ||
"""Rydberg beam channel. | ||
Channel targeting the transition between the ground and rydberg states, | ||
thus enconding the 'ground-rydberg' basis. See base class. | ||
""" | ||
|
||
eom_config: Optional[RydbergEOM] = None | ||
|
||
def __post_init__(self) -> None: | ||
super().__post_init__() | ||
if self.eom_config is not None: | ||
if not isinstance(self.eom_config, RydbergEOM): | ||
raise TypeError( | ||
"When defined, 'eom_config' must be a valid 'RydbergEOM'" | ||
f" instance, not {type(self.eom_config)}." | ||
) | ||
if self.mod_bandwidth is None: | ||
raise ValueError( | ||
"'eom_config' can't be defined in a Channel without a " | ||
"modulation bandwidth." | ||
) | ||
|
||
@property | ||
def basis(self) -> Literal["ground-rydberg"]: | ||
"""The addressed basis name.""" | ||
return "ground-rydberg" | ||
|
||
|
||
@dataclass(init=True, repr=False, frozen=True) | ||
class Microwave(Channel): | ||
"""Microwave adressing channel. | ||
Channel targeting the transition between two rydberg states, thus encoding | ||
the 'XY' basis. See base class. | ||
""" | ||
|
||
@property | ||
def basis(self) -> Literal["XY"]: | ||
"""The addressed basis name.""" | ||
return "XY" |
Oops, something went wrong.