Skip to content

Commit

Permalink
change: make updatedAt optional and add constraints to qubitCount (am…
Browse files Browse the repository at this point in the history
  • Loading branch information
avawang1 authored Aug 4, 2020
1 parent 26a438d commit 3c633e0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 21 deletions.
27 changes: 14 additions & 13 deletions src/braket/device_schema/device_service_properties_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class DeviceCost(BaseModel):
This class provides the details on the cost of a device.
Attributes:
price: Price of the device in terms of US dollars
unit: unit for charging the price, eg: minute, hour, task [price per task]
price (float): Price of the device in terms of US dollars
unit (str): unit for charging the price, eg: minute, hour, task [price per task]
Examples:
>>> import json
Expand All @@ -48,9 +48,9 @@ class DeviceDocumentation(BaseModel):
summary of it and external documentation.
Attributes:
imageUrl: url for the image of the device
summary: brief description on the device
externalDocumentationUrl: link to provide any useful information to the users.
imageUrl (Optional[str]): URL for the image of the device
summary (Optional[str]): brief description on the device
externalDocumentationUrl (Optional[str]): external documentation URL
Examples:
>>> import json
Expand All @@ -72,13 +72,14 @@ class DeviceServiceProperties(BraketSchemaBase):
This class defines the common service properties for each device.
Attributes:
executionWindows: List of the executionWindows, it tells us which days the device can
execute a task.
shotsRange: range of the shots for a given device.
deviceCost: cost of the device to run the quantum circuits
deviceDocumentation: provides device specific details like image, summary etc.
deviceLocation: location fo the device
updatedAt: time when the device properties are last updated.
executionWindows (List[DeviceExecutionWindow]): List of the executionWindows,
it tells us which days the device can execute a task.
shotsRange (Tuple[int, int]): range of the shots for a given device.
deviceCost (Optional[DeviceCost]): cost of the device to run the quantum circuits
deviceDocumentation (Optional[DeviceDocumentation]): provides device specific
details like image, summary etc.
deviceLocation (Optional[str]): location fo the device
updatedAt (Optional[datetime]): time when the device properties are last updated.
Examples:
>>> import json
Expand Down Expand Up @@ -120,4 +121,4 @@ class DeviceServiceProperties(BraketSchemaBase):
deviceCost: Optional[DeviceCost]
deviceDocumentation: Optional[DeviceDocumentation]
deviceLocation: Optional[str]
updatedAt: datetime
updatedAt: Optional[datetime]
4 changes: 2 additions & 2 deletions src/braket/device_schema/gate_model_parameters_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

from pydantic import Field
from pydantic import Field, conint

from braket.schema_common import BraketSchemaBase, BraketSchemaHeader

Expand Down Expand Up @@ -39,4 +39,4 @@ class GateModelParameters(BraketSchemaBase):
name="braket.device_schema.gate_model_parameters", version="1"
)
braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER)
qubitCount: int = Field(gt=0)
qubitCount: conint(ge=0)
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ class GateModelSimulatorDeviceCapabilities(BraketSchemaBase, DeviceCapabilities)
This defines the capabilities of a simulator device.
Attributes:
action: Actions that a simulator device can support
paradigm: Paradigm properties of a simulator
action (Dict[DeviceActionType, JaqcdDeviceActionProperties]): Actions that a
gate model simulator device can support
paradigm (GateModelSimulatorParadigmProperties): Paradigm properties of a simulator
Examples:
>>> import json
Expand Down Expand Up @@ -60,7 +61,7 @@ class GateModelSimulatorDeviceCapabilities(BraketSchemaBase, DeviceCapabilities)
... "deviceDocumentation": {
... "imageUrl": "image_url",
... "summary": "Summary on the device",
... "externalDocumentationUrl": "exter doc link",
... "externalDocumentationUrl": "external doc link",
... },
... "deviceLocation": "us-east-1",
... "updatedAt": "2020-06-16T19:28:02.869136",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.

from pydantic import Field
from pydantic import Field, conint

from braket.schema_common import BraketSchemaBase, BraketSchemaHeader

Expand Down Expand Up @@ -42,4 +42,4 @@ class GateModelSimulatorParadigmProperties(BraketSchemaBase):
name="braket.device_schema.simulators.gate_model_simulator_paradigm_properties", version="1"
)
braketSchemaHeader: BraketSchemaHeader = Field(default=_PROGRAM_HEADER, const=_PROGRAM_HEADER)
qubitCount: int
qubitCount: conint(ge=0)
2 changes: 1 addition & 1 deletion src/braket/ir/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.2.7"
__version__ = "0.2.8"

0 comments on commit 3c633e0

Please sign in to comment.