Coverage for qpdk / samples / filled_resonator.py: 100%

8 statements  

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

1# --- 

2# jupyter: 

3# jupytext: 

4# text_representation: 

5# extension: .py 

6# format_name: percent 

7# format_version: '1.3' 

8# jupytext_version: 1.17.3 

9# --- 

10 

11# %% [markdown] 

12# # Filled Quarter Wave Resonator Sample 

13# 

14# This sample demonstrates how to use the fill_magnetic_vortices helper function to add small rectangles that trap magnetic vortices in superconducting quantum circuits. 

15 

16# %% 

17import gdsfactory as gf 

18 

19from qpdk.cells.helpers import fill_magnetic_vortices 

20from qpdk.cells.resonator import resonator_quarter_wave 

21from qpdk.tech import LAYER 

22 

23# %% [markdown] 

24# ## Filled Quarter Wave Resonator Function 

25# 

26# Creates a quarter wave resonator and fills it with magnetic vortex trapping rectangles. 

27 

28 

29# %% 

30@gf.cell 

31def filled_quarter_wave_resonator(): 

32 """Returns a quarter wave resonator filled with magnetic vortex trapping rectangles. 

33 

34 This sample demonstrates how to use the fill_magnetic_vortices helper function 

35 to add small rectangles that trap magnetic vortices in superconducting quantum 

36 circuits. 

37 

38 Returns: 

39 Component: A quarter wave resonator with fill rectangles for vortex trapping. 

40 """ 

41 # Create a quarter wave resonator 

42 resonator = resonator_quarter_wave(length=2000.0) 

43 

44 # Fill it with magnetic vortex trapping rectangles 

45 return fill_magnetic_vortices( 

46 component=resonator, 

47 rectangle_size=(15.0, 15.0), 

48 gap=15.0, 

49 exclude_layers=[ 

50 (LAYER.M1_ETCH, 20), 

51 ], 

52 ) 

53 

54 

55# %% [markdown] 

56# ## Example Usage 

57# 

58# Demonstrates how to create and display the filled resonator. 

59 

60# %% 

61if __name__ == "__main__": 

62 # Example usage and testing 

63 from qpdk import PDK 

64 

65 PDK.activate() 

66 

67 # Create and display the filled resonator 

68 c = filled_quarter_wave_resonator() 

69 c.show()