Skip to content

Commit

Permalink
Distributed Predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
edyounis committed Sep 9, 2024
1 parent 502cd19 commit 5f219aa
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions bqskit/passes/control/predicates/distributed.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
"""This module implements the DistributedPredicate class."""
from __future__ import annotations

import logging
from typing import TYPE_CHECKING

from bqskit.passes.control.predicate import PassPredicate

if TYPE_CHECKING:
from bqskit.compiler.passdata import PassData
from bqskit.ir.circuit import Circuit

_logger = logging.getLogger(__name__)


class DistributedPredicate(PassPredicate):
"""
The DistributedPredicate class.
The DistributedPredicate returns true if the targeted machine is distributed
across multiple chips.
"""

def get_truth_value(self, circuit: Circuit, data: PassData) -> bool:
"""Call this predicate, see :class:`PassPredicate` for more info."""
return data.model.coupling_graph.is_distributed()

0 comments on commit 5f219aa

Please sign in to comment.