Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Pisal <[email protected]>
  • Loading branch information
sacpis committed Nov 22, 2024
1 parent 0d0cd14 commit a790d8a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions python/cudaq/operator/cudm_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def mul(
coeff=coeff1 * coeff2)
return new_opterm

def _scalar_to_op(
self, scalar: CallbackCoefficient | Number) -> CudmOperatorTerm:
def _scalar_to_op(self,
scalar: CallbackCoefficient | Number) -> CudmOperatorTerm:
op_mat = numpy.identity(self._dimensions[0], dtype=numpy.complex128)
op_term = cudm.tensor_product((cudm.DenseOperator(op_mat), (0,)),
coeff=scalar)
Expand Down
7 changes: 3 additions & 4 deletions python/cudaq/operator/integrators/builtin_integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
except ImportError:
has_cupy = False


class cuDensityMatTimeStepper(BaseTimeStepper[CudmStateType]):

def __init__(self, liouvillian: CudmOperator, ctx: CudmWorkStream):
if not has_cupy:
raise ImportError(
'CuPy is required to use integrators.')
raise ImportError('CuPy is required to use integrators.')
self.liouvillian = liouvillian
self.ctx = ctx
self.state = None
Expand Down Expand Up @@ -58,8 +58,7 @@ def __init__(self,
stepper: BaseTimeStepper[CudmStateType] = None,
**kwargs):
if not has_cupy:
raise ImportError(
'CuPy is required to use integrators.')
raise ImportError('CuPy is required to use integrators.')
super().__init__(**kwargs)
self.stepper = stepper

Expand Down
4 changes: 2 additions & 2 deletions python/cudaq/operator/integrators/scipy_integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
except ImportError:
has_cupy = False


class ScipyZvodeIntegrator(BaseIntegrator[CudmStateType]):
n_steps = 2500
atol = 1e-8
Expand All @@ -34,8 +35,7 @@ def __init__(self, stepper: BaseTimeStepper[CudmStateType], **kwargs):
if not has_scipy:
raise ImportError("scipy is required to use this integrator.")
if not has_cupy:
raise ImportError(
'CuPy is required to use this integrator.')
raise ImportError('CuPy is required to use this integrator.')
super().__init__(**kwargs)
self.stepper = stepper
self.state_data_shape = None
Expand Down

0 comments on commit a790d8a

Please sign in to comment.