Skip to content

Commit

Permalink
Final projector improvements and version bump (#134)
Browse files Browse the repository at this point in the history
  • Loading branch information
RolandMacDoland authored Nov 27, 2023
1 parent 5cfb6d4 commit f892cb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ authors = [
]
requires-python = ">=3.8,<3.12"
license = {text = "Apache 2.0"}
version = "1.0.2"
version = "1.0.3"
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
Expand Down
4 changes: 2 additions & 2 deletions pyqtorch/primitive.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ def __init__(self, target: int):


class Projector(Primitive):
def __init__(self, target: int | tuple[int, ...], ket: str, bra: str):
support = (target,) if isinstance(target, int) else target
def __init__(self, qubit_support: int | tuple[int, ...], ket: str, bra: str):
support = (qubit_support,) if isinstance(qubit_support, int) else qubit_support
if len(ket) != len(bra):
raise ValueError("Input ket and bra bitstrings must be of same length.")
ket_state = product_state(ket).flatten()
Expand Down

0 comments on commit f892cb0

Please sign in to comment.