Skip to content

Commit

Permalink
Dev 0.4.4 (#48)
Browse files Browse the repository at this point in the history
* bumping patch version

* Quera task metadata (#47)

* adding metadata field to QuEraTaskSpecification.

* Adding optional and default value for `metadata`.

* put bound on pydantic.

* add metadata to `discretize`.
  • Loading branch information
weinbe58 authored Apr 23, 2024
1 parent 43ca321 commit c479978
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "quera-ahs-utils"
version = "0.4.3"
version = "0.4.4"
authors = [
{ name="Phillip Weinberg", email="[email protected]" },
{ name="John Long", email="[email protected]" }
Expand All @@ -26,7 +26,7 @@ dependencies = [
"numpy",
"scipy",
"matplotlib",
"pydantic",
"pydantic>=2.0.0",
]

[project.urls]
Expand Down
2 changes: 1 addition & 1 deletion src/quera_ahs_utils/quera_ir/capabilities.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseModel
from pydantic.v1 import BaseModel

__all__ = ["QuEraCapabilities"]

Expand Down
2 changes: 1 addition & 1 deletion src/quera_ahs_utils/quera_ir/task_results.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from enum import Enum
from pydantic import BaseModel, conlist, conint
from pydantic.v1 import BaseModel, conlist, conint
from typing import Callable, Optional, List, Tuple
import numpy as np

Expand Down
6 changes: 4 additions & 2 deletions src/quera_ahs_utils/quera_ir/task_specification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseModel
from pydantic.v1 import BaseModel
from typing import Optional, List, Tuple, Union
from decimal import Decimal

Expand Down Expand Up @@ -155,6 +155,7 @@ class QuEraTaskSpecification(BaseModel):
nshots: int
lattice: Lattice
effective_hamiltonian: EffectiveHamiltonian
metadata: Optional[str] = None

def __hash__(self):
return hash((QuEraTaskSpecification, self.nshots, self.lattice, self.effective_hamiltonian))
Expand All @@ -163,6 +164,7 @@ def discretize(self, task_capabilities: QuEraCapabilities):
return QuEraTaskSpecification(
nshots = self.nshots,
lattice = self.lattice.discretize(task_capabilities),
effective_hamiltonian = self.effective_hamiltonian.discretize(task_capabilities)
effective_hamiltonian = self.effective_hamiltonian.discretize(task_capabilities),
metadata=self.metadata,
)

0 comments on commit c479978

Please sign in to comment.