Skip to content

Commit

Permalink
Update .gitignore, CHANGELOG, and enhance tableau operations with imp…
Browse files Browse the repository at this point in the history
…roved parameter handling
  • Loading branch information
events555 committed Feb 3, 2025
1 parent 53c438d commit 7f435b9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
src/sdim.egg-info/
src/circuits/random_circuit_*.chp
src/circuits/failed_circuit_*.chp
circuits/random*.chp
circuits/failed*.chp
circuits/test*.chp
**/.pytest_cache/
.pytest_cache/
**/__pycache__/
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Update `circuit_io.py` to support named parameters single-qudit gates.
- Included support for inverse symbol of Hadamard in the Cirq circuit diagram.
- Update `tableau_prime.py` to support parallelized for-loops using *numba*

### To-do
- Fix automated deployment with GitHub actions
- Implement two-qubit noise

[1.3.0]: https://github.com/events555/sdim/releases/tag/v1.3.0
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sympy = ">=1.12.1"
cirq = ">=1.0.0"
Diophantine = "*"
numba = "*"
networkx = "^3.4.2"

[tool.poetry.dev-dependencies]
pdoc = "*"
Expand Down
4 changes: 2 additions & 2 deletions sdim/tableau/tableau_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,8 @@ def apply_single_qudit_noise(tableau : Tableau, qudit_index: int, _, params: dic
prob = 0.5
noise_channel = 'd'
else:
prob = float(params['prob'])
noise_channel = params['noise_channel']
prob = float(params.get('prob', 0.5))
noise_channel = params.get('noise_channel', 'd')

# TODO: Sanity check parameters

Expand Down
6 changes: 3 additions & 3 deletions sdim/tableau/tableau_prime.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from typing import Optional, Tuple
from math import gcd
from sdim.tableau.dataclasses import MeasurementResult, Tableau
from sdim.tableau.tableau_optimized import hadamard_optimized, phase_optimized
from sdim.tableau.tableau_optimized import hadamard_optimized, phase_optimized, hadamard_inv_optimized, phase_inv_optimized
from numba import njit, prange

@dataclass
Expand Down Expand Up @@ -136,7 +136,7 @@ def hadamard_inv(self, qudit_index: int):
Args:
qudit_index (int): The index of the qudit to apply the inverse Hadamard gate to.
"""
hadamard_optimized(
hadamard_inv_optimized(
self.x_block, self.z_block, self.phase_vector,
self.destab_x_block, self.destab_z_block, self.destab_phase_vector,
qudit_index, self.num_qudits, self.phase_order
Expand Down Expand Up @@ -203,7 +203,7 @@ def phase_inv(self, qudit_index: int):
Args:
qudit_index (int): The index of the qudit to apply the inverse Phase gate to.
"""
phase_optimized(self.x_block, self.z_block, self.phase_vector,
phase_inv_optimized(self.x_block, self.z_block, self.phase_vector,
self.destab_x_block, self.destab_z_block,
self.destab_phase_vector,
qudit_index,
Expand Down

0 comments on commit 7f435b9

Please sign in to comment.