autoqasm.operators.logical module

Operators for logical boolean operators (e.g. not, and, or).

autoqasm.operators.logical.and_(a: Callable[[], Any], b: Callable[[], Any]) bool | BoolVar[source]

Functional form of “and”.

Parameters:
  • a (Callable[[], Any]) – Callable that returns the first expression.

  • b (Callable[[], Any]) – Callable that returns the second expression.

Returns:

bool | BoolVar – Whether both expressions are true.

autoqasm.operators.logical.or_(a: Callable[[], Any], b: Callable[[], Any]) bool | BoolVar[source]

Functional form of “or”.

Parameters:
  • a (Callable[[], Any]) – Callable that returns the first expression.

  • b (Callable[[], Any]) – Callable that returns the second expression.

Returns:

bool | BoolVar – Whether either expression is true.

autoqasm.operators.logical.not_(a: Any) bool | BoolVar[source]

Functional form of “not”.

Parameters:

a (Any) – Expression to negate.

Returns:

bool | BoolVar – Whether the expression is false.

autoqasm.operators.logical.eq(a: Any, b: Any) bool | BoolVar[source]

Functional form of “equal”.

Parameters:
  • a (Any) – First expression to compare.

  • b (Any) – Second expression to compare.

Returns:

bool | BoolVar – Whether the expressions are equal.

autoqasm.operators.logical.not_eq(a: Any, b: Any) bool | BoolVar[source]

Functional form of “not equal”.

Parameters:
  • a (Any) – First expression to compare.

  • b (Any) – Second expression to compare.

Returns:

bool | BoolVar – Whether the expressions are not equal.