def from_dm(cls, dm, bases, *, force=False):
        if not hasattr(bases, '__iter__'):
            n_qubits = len(dm) // bases.dim_hilbert
            bases = [bases] * n_qubits
        return cls(bases, dm_to_pv(dm, bases), force=force)