qspec logo qspec logo

A physics toolbox for laser spectroscopy.

Static Badge Static Badge Static Badge

Static Badge Static Badge

© 2026 Patrick Müller. All rights reserved.

qspec. cast_sympy  (  *args ,  as_sympy=True ,  dtype=float  )[source]

Cast the arguments args to sympy expressions using sympy.nsimplify or to the specified dtype.

Parameters:
argssympy_scalar

The arguments.

as_sympybool

Whether to cast the arguments to sympy expressions (True) or to dtype (False).

dtypeCallable[[Any], Any]

The type to use if as_sympy is False.

Returns:
args_casttuple[Any, ...]

The cast arguments.