Coverage for jaxquantum/codes/mode.py: 62%
13 statements
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-17 21:51 +0000
« prev ^ index » next coverage.py v7.9.2, created at 2025-07-17 21:51 +0000
1"""
2Generic Bosonic Mode Class
3"""
5from typing import Tuple
7from jaxquantum.codes.base import BosonicQubit
8import jaxquantum as jqt
10from jax import config
12config.update("jax_enable_x64", True)
15class BosonicMode(BosonicQubit):
16 """
17 FockQubit
18 """
20 def _params_validation(self):
21 super()._params_validation()
23 def _get_basis_z(self) -> Tuple[jqt.Qarray, jqt.Qarray]:
24 """
25 Construct basis states |+-x>, |+-y>, |+-z>
26 """
27 N = int(self.params["N"])
28 plus_z = jqt.basis(N, 0)
29 minus_z = jqt.basis(N, 1)
30 return plus_z, minus_z