Photovoltaic windows that can be switched between 4 transparent and energy harvesting mode can be realized by using 5 ultrathin solar absorbers embedded in an optical nanocavity. In the 6 present work, we use a 5 nm thick amorphous germanium absorber 7 integrated in a magnesium-based thin film optical cavity, which 8 switches from an absorptive to a transparent state due to hydrogen 9 absorption. We analyze the influence of the mirror layer thickness 10 on the light absorption, photocurrent generation, and transmission 11 as well as color neutrality of the device. The optical properties are 12 studied by 1-D transfer-matrix method by changing Mg thickness 13 between 0 and 100 nm, then compared to the experimental results of 14 fabricated devices. When the thickness of Mg increases, the switch-15 able average transparency varies between 25% and 0%, while the 16 power conversion efficiency rises up to 2.3%. The applicability of 17 the device is tested by modeling the annual power generation in 18 realistic scenarios. The influence of the cardinal orientation and 19 the seasons on the switchable photovoltaic window implemented in 20 a building facade with the abovementioned parameters is analyzed 21 for different switching scenarios. 22 Index Terms-Magnesium optical switching, smart window, 23 switchable solar cell, ultrathin solar cell. 24 I. INTRODUCTION 25 I N MODERN buildings, huge glass facades often separate the 26 interior from the exterior environment. They are supposed to 27 supply thermal and visual comfort to the inner of the building. 28 To improve this comfort, shading systems have to be imple-29 mented, which provide effective light and heat management 30 [1]-[3]. Dynamic daylight control can be provided by smart 31 windows, which attracted great interest in recent years [4]-[8]. 32 These windows are able to reduce the amount of energy needed 33 for cooling in the building [9]. The emergence of switchable Q1 34 solar cells added a new energy harvesting capability to these 35 smart windows. While still being able to dynamically block 36 sunlight from entering the interior of a building, these smart 37 solar windows generate electricity at the same time. For the 38 realization of a smart photovoltaic window, a technical solution 39 enabling reversible switching from a transparent state to an ab-40 sorbing photovoltaic state is required. Different approaches are 41 523