def from_projector_strings(cls, terms: ProjectorString | list[ProjectorString]) -> ProjectorSum:
        """Builds a ProjectorSum from one or more ProjectorString(s).

        Args:
            terms: Either a single ProjectorString or a list of ProjectorStrings.

        Returns:
            A ProjectorSum.
        """
        if isinstance(terms, ProjectorString):
            terms = [terms]
        termdict: defaultdict[frozenset[tuple[raw_types.Qid, int]], value.Scalar] = defaultdict(
            lambda: 0.0
        )
        for pstring in terms:
            key = frozenset(pstring.projector_dict.items())
            termdict[key] += pstring.coefficient
        return cls(linear_dict=value.LinearDict(termdict))
Builds a ProjectorSum from one or more ProjectorString(s).

        Args:
            terms: Either a single ProjectorString or a list of ProjectorStrings.

        Returns:
            A ProjectorSum.
        
cirq-core/cirq/ops/linear_combinations.py