code: def run(self, ket: State) -> State:
          
          res = [op.run(ket) for op in self.operators]
          probs = [asarray(ket.norm()) * w for ket, w in zip(res, self.weights)]
          probs = np.asarray(probs)
          probs /= np.sum(probs)
          newket = np.random.choice(res, p=probs)
          return newket.normalize()
docs: Apply the action of this Kraus quantum operation upon a state