Coverage for src/braket/circuits/classical_operator.py : 75%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# Copyright 2019-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2#
3# Licensed under the Apache License, Version 2.0 (the "License"). You
4# may not use this file except in compliance with the License. A copy of
5# the License is located at
6#
7# http://aws.amazon.com/apache2.0/
8#
9# or in the "license" file accompanying this file. This file is
10# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11# ANY KIND, either express or implied. See the License for the specific
12# language governing permissions and limitations under the License.
13from typing import Any
15from braket.circuits.operator import Operator
18class ClassicalOperator(Operator):
19 """A classical operator is the definition of a classical operation for a device."""
21 @property
22 def name(self) -> str:
23 """
24 Returns the name of the classical operator
26 Returns:
27 The name of the classical operator as a string
28 """
29 return self.__class__.__name__
31 def to_ir(self, *args, **kwargs) -> Any:
32 """Returns IR representation of operator
34 Args:
35 *args: Positional arguments
36 **kwargs: Keyword arguments
37 """
38 raise NotImplementedError("to_ir has not been implemented yet.")