BaseLoss#

class pyqit.core.BaseLoss(backend=None)[source]#

Bases: _PyQitObject

Base class for backend-dispatching losses.

Subclasses declare what they support through tags rather than through control flow, so a loss missing on one backend fails with a clear message at construction instead of surfacing as an unhandled branch.

Tags#

namestr

Key used by get_loss_fn and by Trainer(loss_fn=...).

backendstuple of str

Backends this loss implements. Any backend listed here must have a matching _pennylane / _torch method.

target_dtype{“float”, “int”}

What the loss expects its targets to be. "int" marks losses taking class indices, which is how the Lightning adapter knows to cast.

classmethod get_test_params()[source]#

List constructor kwargs used to parametrize this class in the test suite.