Coverage for qpdk / cells / airbridge.py: 100%

25 statements  

« prev     ^ index     » next       coverage.py v7.13.4, created at 2026-03-14 10:27 +0000

1"""Airbridge components for superconducting quantum circuits. 

2 

3This module provides airbridge components for crossing transmission lines 

4without electrical contact, essential for complex quantum circuit layouts. 

5Airbridges are elevated metal structures that span over underlying circuits. 

6""" 

7 

8from __future__ import annotations 

9 

10import gdsfactory as gf 

11from gdsfactory.component import Component 

12from gdsfactory.typings import LayerSpec 

13 

14import qpdk.tech as tech 

15from qpdk.tech import LAYER 

16 

17 

18@gf.cell 

19def airbridge( 

20 bridge_length: float = 30.0, 

21 bridge_width: float = 8.0, 

22 pad_width: float = 15.0, 

23 pad_length: float = 12.0, 

24 bridge_layer: LayerSpec = LAYER.AB_DRAW, 

25 pad_layer: LayerSpec = LAYER.AB_VIA, 

26) -> Component: 

27 """Generate a superconducting airbridge component. 

28 

29 Creates an airbridge consisting of a suspended bridge span and landing pads 

30 on either side. The bridge allows transmission lines to cross over each other 

31 without electrical contact, which is essential for complex quantum circuit 

32 routing without crosstalk. 

33 

34 The bridge_layer (AB_DRAW) represents the elevated metal bridge structure, 

35 while the pad_layer (AB_VIA) represents the contact/landing pads that connect 

36 to the underlying circuit. 

37 

38 Note: 

39 To be used with :class:`~gdsfactory.cross_section.ComponentAlongPath` 

40 the unrotated version should be *oriented for placement on a horizontal line*. 

41 

42 Args: 

43 bridge_length: Total length of the airbridge span in µm. 

44 bridge_width: Width of the suspended bridge in µm. 

45 pad_width: Width of the landing pads in µm. 

46 pad_length: Length of each landing pad in µm. 

47 bridge_layer: Layer for the suspended bridge metal (default: AB_DRAW). 

48 pad_layer: Layer for the landing pads/contacts (default: AB_VIA). 

49 

50 Returns: 

51 Component containing the airbridge geometry with appropriate ports. 

52 """ 

53 c = gf.Component() 

54 

55 # Create the suspended bridge 

56 c << gf.components.rectangle( 

57 size=(bridge_length, bridge_width), 

58 layer=bridge_layer, 

59 centered=True, 

60 ) 

61 

62 # Create left landing pad 

63 left_pad = c << gf.components.rectangle( 

64 size=(pad_length, pad_width), 

65 layer=pad_layer, 

66 centered=True, 

67 ) 

68 left_pad.move((-bridge_length / 2 - pad_length / 2, 0)) 

69 

70 # Create right landing pad 

71 right_pad = c << gf.components.rectangle( 

72 size=(pad_length, pad_width), 

73 layer=pad_layer, 

74 centered=True, 

75 ) 

76 right_pad.move((bridge_length / 2 + pad_length / 2, 0)) 

77 

78 # Port configuration data 

79 port_configs = [ 

80 { 

81 "name": "o1", 

82 "center": (0, bridge_width / 2), 

83 "width": bridge_width, 

84 "orientation": 90, 

85 "layer": bridge_layer, 

86 "port_type": "placement", 

87 }, 

88 { 

89 "name": "o2", 

90 "center": (0, -bridge_width / 2), 

91 "width": bridge_width, 

92 "orientation": 270, 

93 "layer": bridge_layer, 

94 "port_type": "placement", 

95 }, 

96 { 

97 "name": "e1", 

98 "center": (-bridge_length / 2 - pad_length, 0), 

99 "width": pad_width, 

100 "orientation": 180, 

101 "layer": pad_layer, 

102 "port_type": "electrical", 

103 }, 

104 { 

105 "name": "e2", 

106 "center": (bridge_length / 2 + pad_length, 0), 

107 "width": pad_width, 

108 "orientation": 0, 

109 "layer": pad_layer, 

110 "port_type": "electrical", 

111 }, 

112 ] 

113 

114 # Add all ports using the configuration data 

115 for config in port_configs: 

116 c.add_port(**config) 

117 

118 c.rotate(90) 

119 

120 return c 

121 

122 

123def cpw_with_airbridges( 

124 airbridge_spacing: float = 100.0, 

125 airbridge_padding: float = 10.0, 

126 bridge_component: Component | None = None, 

127 **cpw_kwargs, 

128) -> gf.CrossSection: 

129 """Create a coplanar waveguide cross-section with airbridges. 

130 

131 This function creates a CPW cross-section that includes airbridges placed 

132 at regular intervals along the transmission line. This is useful for 

133 preventing slot mode propagation and reducing crosstalk in quantum circuits. 

134 

135 Args: 

136 airbridge_spacing: Distance between airbridge centers in µm. 

137 airbridge_padding: Minimum distance from path start to first airbridge in µm. 

138 bridge_component: Custom airbridge component. If None, uses default airbridge. 

139 **cpw_kwargs: Additional arguments passed to the coplanar_waveguide function. 

140 

141 Returns: 

142 CrossSection with airbridges for use in routing functions. 

143 """ 

144 if bridge_component is None: 

145 bridge_component = airbridge() 

146 

147 # Create base CPW cross-section 

148 base_xs = tech.coplanar_waveguide(**cpw_kwargs) 

149 

150 # Create ComponentAlongPath for airbridges 

151 component_along_path = gf.ComponentAlongPath( 

152 component=bridge_component, 

153 spacing=airbridge_spacing, 

154 padding=airbridge_padding, 

155 ) 

156 

157 # Create a copy with airbridges using Pydantic model_copy 

158 return base_xs.model_copy(update={"components_along_path": (component_along_path,)}) 

159 

160 

161if __name__ == "__main__": 

162 # Example usage and testing 

163 from qpdk import PDK 

164 

165 PDK.activate() 

166 

167 # Create and display a single airbridge 

168 bridge = airbridge() 

169 bridge.show()