def METHOD_NAME(
    self,
    samples: Sequence[complex],
    wire_order: Wires,
    shot_range: Tuple[int] = None,
    bin_size: int = None,
):
    if isinstance(self.obs, BasisStateProjector):
        # branch specifically to handle the basis state projector observable
        idx = int("".join(str(i) for i in self.obs.parameters[0]), 2)
        # we use ``self.wires`` instead of ``self.obs`` because the observable was
        # already applied before the sampling
        probs = qml.probs(wires=self.wires).METHOD_NAME(
            samples=samples, wire_order=wire_order, shot_range=shot_range, bin_size=bin_size
        )
        return probs[idx] - probs[idx] ** 2
    # estimate the variance
    samples = qml.sample(op=self.obs).METHOD_NAME(
        samples=samples, wire_order=wire_order, shot_range=shot_range, bin_size=bin_size
    )
    # With broadcasting, we want to take the variance over axis 1, which is the -1st/-2nd with/
    # without bin_size. Without broadcasting, axis 0 is the -1st/-2nd with/without bin_size
    axis = -1 if bin_size is None else -2
    # TODO: do we need to squeeze here? Maybe remove with new return types
    return qml.math.squeeze(qml.math.var(samples, axis=axis))