@value.setter
def value(self, value):
    self._value = value
    calculation = self.ancestor
    hamiltonian = calculation.hamiltonian
    k = calculation.axes.xaxis.photon.k.normalized
    TESLA_TO_EV = 5.7883818011084e-05
    for (i, name) in enumerate(('Bx', 'By', 'Bz')):
        for item in hamiltonian.findChild(name):
            item.value = ((k[i] * value) * TESLA_TO_EV)
@value.setter
def value(self, value):
    self._value = value
    calculation = self.ancestor
    hamiltonian = calculation.hamiltonian
    k = calculation.axes.xaxis.photon.k.normalized
    TESLA_TO_EV = 5.7883818011084e-05
    for (i, name) in enumerate(('Bx', 'By', 'Bz')):
        for item in hamiltonian.findChild(name):
            item.value = ((k[i] * value) * TESLA_TO_EV)