Electrifying the heat supply of buildings is key to mitigate climate change. Inhere, photovoltaic and heat pump systems are promising technologies. Studies indicate that an increase in self-consumption is economically beneficial. Coupling photovoltaic with heat pump systems enables the aspired increase of self-consumption, especially in combination with thermal energy storages. The coupling of the systems is influenced by the control strategies, for which rule-based and model predictive-based approaches exist. Research finds that optimal control methods heavily depend on the system design and vice versa. Contrary to these interdependencies, current design guidelines neglect a possible influence of photovoltaics on the design of the heat pump system. To analyze a possible influence on the optimal heat pump system design, we apply nonlinear, dynamic simulation-based optimization to find the optimal design of the heat pump system for three different cases: no photovoltaic, no supervisory control, and a state-of-the-art supervisory control. The model consists of the whole building energy system, including the building envelope, radiators, a heat pump, a photovoltaic, and a grid connection. The dynamic simulation covers a whole year. To obtain generalizable results, we conduct optimizations for varying boundary conditions, including changes in weather and photovoltaic roof area. Consistent over all boundary conditions, results indicate that cost optimal heat pump system design does not change for current price assumptions. However, maximizing the thermal energy storage is vital to obtain maximal costs savings compared to the case with no photovoltaic system. Thus, for different price assumptions, the optimal design will change.