Hide keyboard shortcuts

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. 

13 

14from typing import List, Optional, Union 

15 

16from braket.ir.jaqcd.instructions import ( 

17 CY, 

18 CZ, 

19 XX, 

20 XY, 

21 YY, 

22 ZZ, 

23 CCNot, 

24 CNot, 

25 CPhaseShift, 

26 CPhaseShift00, 

27 CPhaseShift01, 

28 CPhaseShift10, 

29 CSwap, 

30 H, 

31 I, 

32 ISwap, 

33 PhaseShift, 

34 PSwap, 

35 Rx, 

36 Ry, 

37 Rz, 

38 S, 

39 Si, 

40 Swap, 

41 T, 

42 Ti, 

43 Unitary, 

44 V, 

45 Vi, 

46 X, 

47 Y, 

48 Z, 

49) 

50from braket.ir.jaqcd.results import ( 

51 Amplitude, 

52 Expectation, 

53 Probability, 

54 Sample, 

55 StateVector, 

56 Variance, 

57) 

58from pydantic import BaseModel 

59 

60 

61class Program(BaseModel): 

62 """ 

63 Root object of the JsonAwsQuantumCircuitDescription IR. 

64 

65 Attributes: 

66 - instructions: List of instructions. 

67 

68 Examples: 

69 >>> Program(instructions=[H(target=0), Rz(angle=0.15, target=1)]) 

70 """ 

71 

72 instructions: List[ 

73 Union[ 

74 CCNot, 

75 CNot, 

76 CPhaseShift, 

77 CPhaseShift00, 

78 CPhaseShift01, 

79 CPhaseShift10, 

80 CSwap, 

81 CY, 

82 CZ, 

83 H, 

84 I, 

85 ISwap, 

86 PhaseShift, 

87 PSwap, 

88 Rx, 

89 Ry, 

90 Rz, 

91 S, 

92 Swap, 

93 Si, 

94 T, 

95 Ti, 

96 Unitary, 

97 V, 

98 Vi, 

99 X, 

100 XX, 

101 XY, 

102 Y, 

103 YY, 

104 Z, 

105 ZZ, 

106 ] 

107 ] 

108 results: Optional[ 

109 List[Union[Amplitude, Expectation, Probability, Sample, StateVector, Variance]] 

110 ]