# Modularity in NEAT Reinforcement Learning Networks

Humphrey Munn  The University of QueenslandBrisbaneQueenslandAustralia and
Marcus Gallagher  The University of QueenslandBrisbaneQueenslandAustralia

(2022)

###### Abstract.

Modularity is essential to many well-performing structured systems, as it is a
useful means of managing complexity (Ethiraj and Levinthal, 2004). An analysis
of modularity in neural networks produced by machine learning algorithms can
offer valuable insight into the workings of such algorithms and how modularity
can be leveraged to improve performance. However, this property is often
overlooked in the neuroevolutionary literature, so the modular nature of many
learning algorithms is unknown. This property was assessed on the popular
algorithm “NeuroEvolution of Augmenting Topologies” (NEAT) for standard
simulation benchmark control problems due to NEAT’s ability to optimise
network topology. This paper shows that NEAT networks seem to rapidly increase
in modularity over time with the rate and convergence dependent on the
problem. Interestingly, NEAT tends towards increasingly modular networks even
when network fitness converges. It was shown that the ideal level of network
modularity in the explored parameter space is highly dependent on other
network variables, dispelling theories that modularity has a straightforward
relationship to network performance. This is further proven in this paper by
demonstrating that rewarding modularity directly did not improve fitness.

††copyright: rightsretained††journalyear: 2022††price: 15.00

##  1\. Introduction

A long-standing interest in the field of neuroevolution has been studying the
selective advantage of modularity in neural networks (Clune et al., 2013).
Neuroevolution seeks to find the optimal structure and connection weights of a
network to best solve a given problem (Floreano et al., 2008). Most structured
systems can be represented as a graph (Girvan and Newman, 2002), such as
social networks, road networks, organizations, and the human brain (Høverstad,
2011). Where structure is important, modularity often determines the success
of such systems. Road networks are denser within cities than between them, and
communication within departments is typically greater than between
departments. This heterogeneity of connections between network parts is what
defines the modularity of the whole network. Despite obvious benefits, the
amount of modularity and organisation optimal for a given problem is unclear
and is an active area of research in many disciplines (Newman, 2006).

Learning algorithms behind artificial neural networks (ANNs) have had a global
impact, as they provide a framework for automated learning and problem solving
applicable to many domains of understanding. Therefore, their analysis and
improvement can have a significant impact on the scientific field. The
algorithm of focus in this paper is “NeuroEvolution of Augmenting Topologies”
(NEAT), an evolutionary-based approach for evolving network structures and
weights (Stanley and Miikkulainen, 2002). The impact of NEAT is illustrated in
its application to a variety of real-world problem and presence in important
research. These include “Measurement of the Top Quark-Mass” (Aaltonen et al.,
2009), “Predicting the conformational flexibility of amino acids” (Grisci and
Dorn, 2017) and evacuation modelling (Yuksel, 2018). NEAT has also spawned
many variants of which take significant inspiration from NEAT’s mechanism for
topological evolution (Papavasileiou et al., 2021). This paper aims to
investigate the modular dynamics of NEAT, and its significance towards NEAT’s
performance.

This paper applies NEAT to three reinforcement learning (RL) benchmark
problems. Reinforcement learning is a valuable paradigm for testing as it
involves sequential decision making in an environment, applicable to tasks
such as robot learning (Wiering and Van Otterlo, 2012). There are many
benchmark RL problems, such as the simulation environments provided by
OpenAI’s gym (Brockman et al., 2016) used in this paper.

The results of this paper show that the optimal modularity in an ANN is
conditional on other network properties, and as such direct optimisation of
modularity does not appear to offer performance benefits. MAP-Elites is used
to show that NEAT-based networks can achieve superior performance when the
conditional effect of another measure of network behaviour is optimised
alongside modularity. The dynamics of modularity in NEAT are explored with
NEAT inherently tending towards increasingly modular networks regardless of
whether fitness has converged.

This paper will offer three main contributions. Firstly, it will explore how
modularity evolves in NEAT for different problems over time. Multi-objective
optimization is examined, where networks are rewarded to different degrees for
exhibiting modular structure. Finally, a simple method using the MAP-Elites
algorithm (Mouret and Clune, 2015) is presented for analysing the effect of
modularity on the fitness landscape of networks and for demonstrating the
conditional relationship modularity has to other network measures.

The implementation for this project is available at
humphreymunn/ModularityNEAT.

##  2\. Background

Artificial neural networks (ANNs) have become ubiquitous in science and
technology as they provide a framework for automated learning and problem
solving. They are graphical in nature, and optimization of ANN structure is an
active area of research due to the large influence network structure and
configuration has on performance (Stanley et al., 2019).

One recent approach to optimizing network structure and learning is the field
of neuroevolution (NE). It is inspired by biological evolution: by encoding
parameters of the network such as structure and weights into an artificial
genome, they can be mutated or used in network procreation by recombination of
two parent networks. A population of solutions is stored, and artificial
selection is applied at each generation to continually evolve only the highest
performing networks found over successive generations (Floreano et al., 2008).

An important feature of networks is their modular structure, as it can improve
evolvability and learning (Clune et al., 2010). Modularity has gained some
attention in the neuroevolution community, and several ideas have been
recently proposed to explain its evolutionary advantage (Clune et al., 2013)
and how it can be leveraged to learn higher-performing networks. This suggests
an analysis of the dynamics of modularity over training time in popular
learning algorithms such as backpropagation and neuroevolution is beneficial.
This has already led to improvements in fields such as deep learning (Amer and
Maul, 2019).

Qiao and Gallagher (Qiao and Gallagher, 2020) describe the three classes of
modularity optimization: 1. Manually splitting tasks into modules using human
knowledge 2. Add evolutionary objectives to apply selective pressure towards
modular structure and 3. Use a genome structure that explicitly encodes
modularity so modular networks naturally form. Their paper re-explores the
MENNAG algorithm (Mouret and Doncieux, 2008) that explicitly encodes
modularity in the genome and shows that this is beneficial for problems with a
modular nature. An example of utilising human knowledge for modularity is
presented by Togelius (Togelius, 2004) called layered evolution, which
outperforms related methods on robotics tasks. This technique involves users
defining sub-behaviours of increasing complexity that the system tries to
solve. The system learns automatically which of the learned modules to use for
higher-level behaviours, eventually leading to a fully functioning system.
Finally, (Huizinga et al., 2014) demonstrates that an additional objective
towards modularity exceptionally improved performance for the HyperNEAT
algorithm on some problems. They indirectly optimize modularity using the
connection cost technique, which penalises networks by the number of
connections they have. This technique has been shown to often increase
performance and modularity of solutions (Huizinga et al., 2016; Ellefsen et
al., 2015; Clune et al., 2013).

This paper explores the technique of directly adding modularity as an
evolutionary objective to NEAT networks. This is done for three reasons. 1.
This is by far the easiest method, and if high-performing modular networks can
be obtained this way there is no need for more complex methods. 2. To our
knowledge, there is only one paper (Huizinga et al., 2016) that optimizes
modularity directly for any neuroevolutionary algorithm, meaning there is
potential for this to be an unexplored, effective strategy. 3. To test the
assumption that the relationship between modularity and fitness can be
disentangled via multi-objective optimisation. (Huizinga et al., 2016) does
not successfully use single objectives due to the complexity of the robot
locomotion tasks, and instead uses a combinatorial multi-objective
evolutionary algorithm incorporating many objectives including modularity to
obtain optimal solutions. The multi-objective technique is generally more
flexible as it can be added onto existing algorithms and does not require
domain knowledge from humans, which are inherently biased, difficult to obtain
and are often outperformed by automated learning algorithms. Furthermore,
exploring modular properties of existing algorithms can assist researchers in
their choice of algorithm or help in the development of new, higher-performing
algorithms that consider properties of network modularity.

###  2.1. Modularity Metric (Q-Score)

The modularity of networks is often defined by their Q-Score (Newman, 2006;
Guimera and Nunes Amaral, 2005), where:

(1)
$Q=\sum_{s=1}^{K}\left[\frac{l_{s}}{L}-\left(\frac{d_{s}{{}^{2}}}{2L}\right)\right]$

and K is the number of modules, L is the number of edges, $l_{s}$ is the
number of edges within module s, $d_{s}$ is the sum of node degrees in s. A
close approximation of the optimal Q-Score is used, as direct calculation is a
NP-Hard problem (Brandes et al., 2006). Intuitively, maximising the Q-Score
will calculate the optimal groupings of modules in the graph, and this maximal
score determines the network modularity.

###  2.2. NeuroEvolution of Augmenting Topologies (NEAT)

NeuroEvolution of Augmenting Topologies is a popular neuroevolutionary
algorithm to evolve network structure and weights (Stanley and Miikkulainen,
2002). It is recognizable for its similarities to natural evolution. NEAT
proposes an innovative method of recombination of two parent networks of
different structures or topologies, by crossing genes with the same historical
markings - analogous to alleles in DNA recombination. A population can become
divided into different species over time based on structural differences in
genomes, resulting in selection of the fitness individuals to reproduce for
the next generation to occur separately for each species. This protects newly
created structures from immediately dying off before their weights are yet to
be fine-tuned. This also allows for increasing complexity of structures if
this provides selection advantage, enabling NEAT to find an optimal level of
network complexity. NEAT also offers many types of possible mutations to the
structure and weights, increasing the network search space.

###  2.3. Reinforcement Learning Benchmark Problems

Reinforcement Learning is an important paradigm in machine learning, concerned
with sequential decision making in an environment (Wiering and Van Otterlo,
2012). Three benchmark reinforcement learning environments from OpenAI’s Gym
were tested: Bipedal Walker, Acrobot, and Continuous Lunar Lander.

####  2.3.1. Bipedal Walker

The bipedal walker task requires the agent to walk to the end of the
environment (Figure 1). Agent reward is simply the distance travelled in the
time limit, with a penalty for falling over. The state space consists of 24
values: 10 lidar readings, each joint angle and speed, leg ground contacts, x
and y velocity, hull angle and hull angular velocity. The action space or
output is the torque to be applied to each of the two hip joints and two knee
joints. That is, $A\in[-1,1]^{4}$.

Figure 1. Bipedal Walker Environment

####  2.3.2. Continuous Lunar Lander

The continuous lunar lander task requires the agent to navigate a lunar lander
to the landing pad at coordinates (0,0) in a simulated physics environment
(Figure 2). Agent rewards depend on how close the landing is to (0,0), how
much throttle is used (to maximise fuel efficiency), and whether the agent
lands safely. The state space is given by the Lander’s coordinates (x,y),
velocities (x,y), angle and angular velocity, and left leg and right leg
contact with the ground (true / false). The action space or output is two
values: 1. the main engine throttle, and 2. the left/right engine throttle
(left is in [-1,-0.5], right is in [0.5, 1]), where $A\in[-1,1]^{2}$.

Figure 2. Continuous Lunar Lander Environment

####  2.3.3. Acrobot

The Acrobot task requires the agent to control an actuated joint to swing a
two-link pendulum above a specified height (Figure 3). The reward is simply
how fast the agent can solve the task. The state space consists of the sine
and cosine for each joint angle, and the angular velocity for each joint. The
action at each time step is the torque to be applied on the joint. That is,
$A\in\\{-1,0,1\\}$.

Figure 3. Acrobot Environment

###  2.4. MAP-Elites

MAP-Elites is an evolutionary algorithm that creates a map or grid of high-
performing solutions, where the dimensions of the grid are important features
of the problem decided by the user. In this paper for example, network
modularity is one of these important features. Each grid square represents the
highest fitness individual whose features are within the ranges defined by the
grid cell position, and the colour is the individual’s fitness. The algorithm
generates an initial random population, which is added to the grid. Then at
each generation, a set number of individuals are procreated and mutated to
create offspring, which are then added to the grid. If two individuals overlap
on the grid, the highest fitness individual is kept. This strategy has been
shown to often outperform direct optimization of performance, as it typically
explores more of the search space, biased by important features (Mouret and
Clune, 2015). Furthermore, it provides information about the fitness landscape
of individuals, revealing important features of the applied problem or
genotype/phenotype mapping.

###  2.5. Deviation from Uniform Torque Output Distribution

For reinforcement learning tasks, the amount each network output node is
activated largely impacts its behaviour. For example, a local optima to the
bipedal walking task could involve only applying torque to one knee joint.

A simple method of approximating the deviation from an equal output neuron
usage distribution is used to obtain a network feature in the range [0,1]. The
range rule of thumb is a common approximation to the sample standard
deviation, such that $S\approx\frac{b-a}{4}$, where b - a is the sample range
(Wan et al., 2014). An array of the total absolute torque applied to each
joint over the episode time is stored, $X=[x_{1},x_{2},...,x_{n}]$ where n =
number of output neurons. The average over all episodes is taken. As the
minimum range is 0, and maximum is $max\\{X\\}$, the normalized approximate
deviation is then,

(2) $D=\frac{max\\{X\\}-min\\{X\\}}{max\\{X\\}},D\in[0,1]$

(a) BipedalWalker environment.

(b) ContinuousLunarLander environment.

(c) Acrobot environment.

Figure 4. Average fitness and modularity of best networks at each generation
from 20 runs. Confidence interval is one standard deviation. Population size
is 400.

(a) BipedalWalker environment.

(b) ContinuousLunarLander environment.

(c) Acrobot environment.

Figure 5. Violin plots of fitness and modularity of best networks at each
generation from 20 runs.

##  3\. Methods

Modularity and fitness from the NEAT algorithm were measured on three
benchmark problems. 20 runs of the learning process were performed for each
problem. NEAT hyperparameters were similar to the neat-openai-gym GitHub
repository (Rojas, 2017) as these were found to work well and did not need
further tuning. A 5-episode, 10-episode and 20-episode average was used during
training for BipedalWalker, ContinuousLunarLander and Acrobot respectively to
minimise noise when measuring fitness. The default feed-forward network
configuration was used for the BipedalWalker and ContinuousLunarLander tasks,
whereas Acrobot used a recurrent NEAT network.

Multi-objective optimization via adding an additional modularity reward to the
fitness function was also assessed on BipedalWalker with varying levels of
reward significance. This reward was scaled with the current fitness to bias
increasingly modular networks as the population starts converging. An
importance metric was defined, which was the maximum percentage of the current
fitness that can be added to the fitness function. The new fitness function
was defined as,

(3) $F=R+Q\cdot I\cdot(min\\{max\\{R,a\\},b\\}+a)$

where F = fitness, R = reward, Q = Q-Score, I = Q-Importance hyper-parameter,
(a,b) = lower and upper fitness bounds. This results in a fitness function
where an increase in environment reward will increase modularity desirability
and visa-versa.

Finally, the MAP-Elites algorithm was run on the BipedalWalker task, as this
task was the most interesting due to its challenging nature. Two feature
descriptors were applied: network Q-Score and torque output deviation
(Equation 2). The grid was of size 20x20 to reduce the computational cost of a
large grid. At each generation, 12 progeny were created with a mutation
probability of 0.75 and crossover probability of 0.3 by random selection of
solutions stored in the grid. Changing these probabilities had negligible
effects on the map. The 12 progeny were tested in parallel at each generation.
This was run for 30000 generations, where the grid had mostly converged by
this time.

##  4\. Results

###  4.1. Original NEAT Modularity & Fitness

The modularity and fitness for the three reinforcement learning tasks using
NEAT are displayed in Figure 4 and Figure 5. In all three tasks, modularity
increased over each generation in the fittest individuals. The rate of
increase and convergence differed between problems significantly. Both
BipedalWalker and Acrobot experience a convergence of fitness but an increase
in modularity that extends past this convergence. Modularity appears to have
converged in ContinuousLunarLandar and Acrobot at the end of training but not
for the BipedalWalker. Modularity appears normally distributed over runs, as
well as fitness except for BipedalWalker which has a bimodal distribution
suggesting the algorithm often gets stuck in a locally optimal behaviour.

###  4.2. Rewarding Modularity on BipedalWalker

Figure 6 (top) shows the best fitness for importance values {0, 0.1, 0.125,
0.15, 0.175, 0.2} averaged over 20 runs (see Equation 3). There does not
appear to be a linear relationship between increased modularity rewards and
performance. While some particular values of I (0.175, 0.125) had higher
average performance, this was not found to be statistically significant.
Figure 6 (bottom) shows the differences in how modularity evolves with these
different reward amounts. There is a clear linear relationship to increased
modularity rewards and a higher modularity indicating the reward function was
effective.

Figure 6. Best fitness (top) and modularity (bottom) for each tested
Q-Importance level (see Equation 3). Each test is 10 runs, with 1 standard
deviation confidence intervals.

###  4.3. MAP-Elites for BipedalWalker

The MAP-Elites algorithm was run on the BipedalWalker task for 30000
generations. Figure 7 clearly shows the importance of each feature, with the
hot-spot of high-performing networks within the ranges
$Q\in[0.25,0.5],D\in[0.55,0.7]$. Modularity has reasonably performing
solutions for all values, however D (see Equation 2) is consistently poor past
0.8. This should correspond to the networks using predominantly a single
output out of the 4 available. There are 2 main regions that are above 200
fitness, which correspond to different walking strategies. The highest-
performing solution had a fitness of 254, which is higher than solutions
obtained from standard NEAT (~248) in the previous experiments. Despite this,
using D did not lead to networks with an optimal gait that solved
BipedalWalker as this requires an average fitness of at least 300.

Figure 7. MAP-Elites grid for BipedalWalker task.

##  5\. Discussion

These results show new insights about the workings of ANN modularity and its
dynamics in neuroevolution, specifically with NEAT. One important observation
is how the rate of change and convergence of the Q-Score depends on numerous
factors. This paper supports the literature that claims the ideal range of
modularity in networks is problem dependent. Qiao and Gallagher (Qiao and
Gallagher, 2020) show that Q-Score population averages for the MENNAG
algorithm were distinct for the three tested problems, with BipedalWalker
averaging $Q\approx 0.53$ after training. In comparison, our MAP-ELITES and
NEAT experiments had optimal solutions, although with a lower fitness, for
values $Q\in\approx[0.25,0.7]$. Ethiraj and Levinthal (Ethiraj and Levinthal,
2004) found intermediate levels of modularity resulted in the highest
performance on a formal simulation model of organizational systems. The three
tasks tested in this paper also exhibit different optimal Q-Score ranges,
which seem to reflect the modular nature of each task. Furthermore,
Suchorzewski and Clune (Suchorzewski and Clune, 2011) show that DSE
(Developmental Symbolic Encoding) converged to a Q-score of 0.65 whereas
Hyper-NEAT converged to 0.4 on the same retina problem. This suggests that the
best level of modularity is influenced by multiple factors, including the
algorithm and problem environment.

The MAP-Elites experiment in Figure 7 shows that the ideal modularity range
can be conditionally dependent on other variables from a network. This
algorithm and visualisation offers a unique way of understanding the effects
of different network variables on an applied problem. The range of modularity
which produced the best individuals from this experiment differs to the NEAT
experiments in Figure 4, 5 and 6 despite sharing the same genotype-phenotype
mapping. This suggests the selection criteria has an important influence on an
optimal level of modularity, as all other aspects of the algorithm are
identical to NEAT. This conditional dependence explains why a multi-objective
approach optimising fitness and modularity directly does not lead to faster
convergence or significantly higher performance (Figure 6). This may appear to
be opposing findings that show rewarding modularity improves performance, such
as the connection cost technique (Huizinga et al., 2014). However, (Huizinga
et al., 2014) does not provide a objective that is purely modularity-based,
and may be due to the introduced pressure on the learning algorithm to produce
sparse networks.

Interestingly, on both BipedalWalker and Acrobot tasks, modularity increases
past the point where fitness converges as demonstrated in Figure 4. This
property is not present in the literature. This effect may be due to an
inherent bias in the NEAT algorithm towards more modular topologies. One
hypothesis may be that NEAT has a bias for increased complexity, which is
balanced out through increased modularity. This supports the popular idea that
modularity can be a means of managing complexity (Ethiraj and Levinthal,
2004). This process may not escape local optima where fundamentally new
networks are required for a different gait or strategy, instead of higher
network complexity.

##  6\. Conclusion

It is clear that modularity plays an important role in the success of
neuroevolutionary learning algorithms. The speed, convergence point, and best
values of modularity were shown to be influenced by the problem environment
and the selection criteria of the evolutionary process. NEAT can be expected
to increase modularity of solutions significantly throughout training which
appears to imply a selectional advantage towards modularity. However, the
modularity in the population can increase even after fitness has converged
which indicates a bias for modular solutions in NEAT. This should be explored
further as this property may benefit or hinder the algorithm significantly.
Finally, it was shown that the ideal level of modularity found by the learning
process is conditionally dependent on other network metrics so a direct
optimisation approach to modularity is unlikely to help during network
training.

## References

  * (1)
  * Aaltonen et al. (2009) Timo Aaltonen, J Adelman, T Akimoto, MG Albrow, B Alvarez Gonzalez, S Amerio, D Amidei, A Anastassov, A Annovi, J Antos, et al. 2009\.  Measurement of the top-quark mass with dilepton events selected using neuroevolution at CDF.  Physical review letters 102, 15 (2009), 152001\.
  * Amer and Maul (2019) Mohammed Amer and Tomás Maul. 2019.  A review of modularization techniques in artificial neural networks.  Artificial Intelligence Review 52, 1 (2019), 527–561.
  * Brandes et al. (2006) Ulrik Brandes, Daniel Delling, Marco Gaertler, Robert Görke, Martin Hoefer, Zoran Nikoloski, and Dorothea Wagner. 2006\.  Maximizing modularity is hard.  arXiv preprint physics/0608255 (2006).
  * Brockman et al. (2016) Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. 2016.  Openai gym.  arXiv preprint arXiv:1606.01540 (2016).
  * Clune et al. (2010) Jeff Clune, Benjamin E Beckmann, Philip K McKinley, and Charles Ofria. 2010.  Investigating whether HyperNEAT produces modular neural networks. In Proceedings of the 12th annual conference on Genetic and evolutionary computation. 635–642.
  * Clune et al. (2013) Jeff Clune, Jean-Baptiste Mouret, and Hod Lipson. 2013\.  The evolutionary origins of modularity.  Proceedings of the Royal Society b: Biological sciences 280, 1755 (2013), 20122863.
  * Ellefsen et al. (2015) Kai Olav Ellefsen, Jean-Baptiste Mouret, and Jeff Clune. 2015\.  Neural modularity helps organisms evolve to learn new skills without forgetting old skills.  PLoS computational biology 11, 4 (2015), e1004128.
  * Ethiraj and Levinthal (2004) Sendil K Ethiraj and Daniel Levinthal. 2004.  Modularity and innovation in complex systems.  Management science 50, 2 (2004), 159–173.
  * Floreano et al. (2008) Dario Floreano, Peter Dürr, and Claudio Mattiussi. 2008\.  Neuroevolution: from architectures to learning.  Evolutionary intelligence 1, 1 (2008), 47–62.
  * Girvan and Newman (2002) Michelle Girvan and Mark EJ Newman. 2002.  Community structure in social and biological networks.  Proceedings of the national academy of sciences 99, 12 (2002), 7821–7826.
  * Grisci and Dorn (2017) Bruno Grisci and Márcio Dorn. 2017.  NEAT-FLEX: Predicting the conformational flexibility of amino acids using neuroevolution of augmenting topologies.  Journal of Bioinformatics and Computational Biology 15, 03 (2017), 1750009.
  * Guimera and Nunes Amaral (2005) Roger Guimera and Luís A Nunes Amaral. 2005.  Functional cartography of complex metabolic networks.  nature 433, 7028 (2005), 895–900.
  * Høverstad (2011) Boye Annfelt Høverstad. 2011\.  Noise and the evolution of neural network modularity.  Artificial life 17, 1 (2011), 33–50.
  * Huizinga et al. (2014) Joost Huizinga, Jeff Clune, and Jean-Baptiste Mouret. 2014\.  Evolving neural networks that are both modular and regular: Hyperneat plus the connection cost technique. In Proceedings of the 2014 Annual Conference on Genetic and Evolutionary Computation. 697–704.
  * Huizinga et al. (2016) Joost Huizinga, Jean-Baptiste Mouret, and Jeff Clune. 2016\.  Does aligning phenotypic and genotypic modularity improve the evolution of neural networks?. In Proceedings of the Genetic and Evolutionary Computation Conference 2016. 125–132.
  * Mouret and Clune (2015) Jean-Baptiste Mouret and Jeff Clune. 2015.  Illuminating search spaces by mapping elites.  arXiv preprint arXiv:1504.04909 (2015).
  * Mouret and Doncieux (2008) Jean-Baptiste Mouret and Stéphane Doncieux. 2008.  MENNAG: a modular, regular and hierarchical encoding for neural-networks based on attribute grammars.  Evolutionary Intelligence 1, 3 (2008), 187–207.
  * Newman (2006) Mark EJ Newman. 2006\.  Modularity and community structure in networks.  Proceedings of the national academy of sciences 103, 23 (2006), 8577–8582.
  * Papavasileiou et al. (2021) Evgenia Papavasileiou, Jan Cornelis, and Bart Jansen. 2021\.  A Systematic Literature Review of the Successors of “NeuroEvolution of Augmenting Topologies”.  Evolutionary Computation 29, 1 (2021), 1–73.
  * Qiao and Gallagher (2020) Yukai Qiao and Marcus Gallagher. 2020.  An Implementation and Experimental Evaluation of a Modularity Explicit Encoding Method for Neuroevolution on Complex Learning Tasks. In Australasian Joint Conference on Artificial Intelligence. Springer, 138–149.
  * Stanley et al. (2019) Kenneth O Stanley, Jeff Clune, Joel Lehman, and Risto Miikkulainen. 2019.  Designing neural networks through neuroevolution.  Nature Machine Intelligence 1, 1 (2019), 24–35.
  * Stanley and Miikkulainen (2002) Kenneth O Stanley and Risto Miikkulainen. 2002.  Evolving neural networks through augmenting topologies.  Evolutionary computation 10, 2 (2002), 99–127.
  * Suchorzewski and Clune (2011) Marcin Suchorzewski and Jeff Clune. 2011.  A novel generative encoding for evolving modular, regular and scalable networks. In Proceedings of the 13th annual conference on Genetic and evolutionary computation. 1523–1530.
  * Togelius (2004) Julian Togelius. 2004\.  Evolution of a subsumption architecture neurocontroller.  Journal of Intelligent & Fuzzy Systems 15, 1 (2004), 15–20.
  * Wan et al. (2014) Xiang Wan, Wenqian Wang, Jiming Liu, and Tiejun Tong. 2014\.  Estimating the sample mean and standard deviation from the sample size, median, range and/or interquartile range.  BMC medical research methodology 14, 1 (2014), 1–13.
  * Wiering and Van Otterlo (2012) Marco A Wiering and Martijn Van Otterlo. 2012.  Reinforcement learning.  Adaptation, learning, and optimization 12, 3 (2012), 729\.
  * Yuksel (2018) Mehmet Erkan Yuksel. 2018\.  Agent-based evacuation modeling with multiple exits using NeuroEvolution of Augmenting Topologies.  Advanced Engineering Informatics 35 (2018), 30–55.


# Symmetry and shape on the plasmonic behaviour of nanocavities

Kalun Bedingfield  School of Physics and Astronomy, University of Birmingham,
Edgbaston, Birmingham, B15 2TT, UK  Eoin Elliott  School of Physics and
Astronomy, University of Birmingham, Edgbaston, Birmingham, B15 2TT, UK
NanoPhotonics Centre, Cavendish Laboratory, University of Cambridge, Cambridge
CB3 0HE, UK  Arsenios Gisdakis  School of Physics and Astronomy, University of
Birmingham, Edgbaston, Birmingham, B15 2TT, UK  Nuttawut Kongsuwan  Thailand
Center of Excellence in Physics, Ministry of Higher Education, Science,
Research and Innovation, Bangkok 10400, Thailand  Quantum Technology
Foundation (Thailand), Bangkok 10110, Thailand  Jeremy J Baumberg
<EMAIL_ADDRESS>NanoPhotonics Centre, Cavendish Laboratory, University of
Cambridge, Cambridge CB3 0HE, UK  Angela Demetriadou<EMAIL_ADDRESS>School of Physics and Astronomy, University of Birmingham, Edgbaston,
Birmingham, B15 2TT, UK

(Dated: )

###### Abstract

Plasmonic nanocavities confine light in deep subwavelength volumes and in
recent years have enabled unprecedented control on light-matter interactions.
A characteristic example is the nanoparticle-on-mirror geometry, which allows
for the fabrication of very robust plasmonic gaps with sub-nanometre accuracy.
Due to the extreme field confinement, the size and shape of plasmonic
nanocavities dominate their optical response. But so far, the community has
mainly focused on idealized spherical nanoparticles, ignoring that during
their synthesis nanoparticles actually acquire polyhedral shapes, and that
many different geometries can be synthesised these days. Here, we provide a
complete description of the plasmonic modes in nanocavities made of three
commonly occurring polyhedral nanoparticles (cuboctahedron,
rhombicuboctahedron, decahedron). We show that the shape and symmetry of these
plasmonic nanocavities dominate both their near- and far-field response, with
intricate and rich optical behaviour. Through a recombination technique, the
total far-field emission profile is obtained for an emitter placed at various
nanocavity positions, which is crucial for understanding how energy couples in
and out of the nanocavity. This work paves the way towards controlling light-
matter interactions in extreme plasmonic environments for various
applications, such as photochemical reactions and non-linear vibrational
pumping.

Plasmonic nanoparticles (NPs) enhance and confine electromagnetic fields to
sub-wavelength volumes to greatly increase light-matter interactions. In
recent years, tremendous effort has been invested on fabricating and
synthesising NPs of various shapes [1, 2] that has fuelled advances in
biological sensing [3], sensing and tracking of chemical reactions [4, 5], hot
electron generation [6] and enhance non-linear processes [7]. By tightly
coupling two or more plasmonic nanoparticles, one can further confine light to
extremely deep sub-wavelength volumes, creating plasmonic nanocavities that
further enhance light-matter interactions [8, 9, 10, 11, 12, 13, 14, 15, 16,
17]. Plasmonic nanocavities typically have gaps between nanoparticles of just
$1-2$nm, where the light is confined, and have shown extreme optical behaviour
[18, 19, 20, 21, 22, 23, 24], with many unprecedented applications [25, 26,
27, 11, 28] Due to this extreme sub-wavelength light confinement, the shape
and symmetry of plasmonic nanocavities, even at the few nanometer-scale,
dominate their optical and spectral behaviour. By understanding the light
confinement in such extreme plasmonic nanocavities, one can essentially
control light-matter interactions for various nanocavity applications, such as
enhancing exciton photoluminescence [29], nonlinear vibrational pumping [30],
sensing, mid-infrared upconversion detectors [31] and hot-electron emission
[6].

Figure 1: A. TSoM schematic for a gold NP of radius $r_{p}$ with a circular
facet of diameter $f_{d}$ assembled a distance $d$ above a flat gold
substrate, separated by a spacer of refractive index $n$. Polyhedral NP
structures above their corresponding scanning electron microscopy images: (B)
cuboctahedron, (C) rhombicuboctahedron and (D) decahedron [32]. The green, red
and blue facets refer to planes of gold atom crystallization $\\{100\\}$,
$\\{110\\}$ and $\\{111\\}$, respectively.

All these applications depend strongly on the interaction of a
molecule/emitter with the plasmon modes of the nanocavity, and ultimately the
shape and symmetry of the nanocavity. So far, plasmonic nanocavities have been
primarily explored experimentally [13, 21, 22], with their optical behaviour
observed and measured in the far-field, mainly via scattering methods such as
dark-field microscopy. Although theoretical studies can provide the near-field
within nanocavities, they have primarily focused on particular incident field
excitations [14, 19, 20, 22, 33, 34, 35, 36] and idealized spherical (or
truncated spherical) NP shapes [33, 37]. Such calculations provide a very
limited view of light-matter interactions occurring between the plasmon modes
and the molecules in realistic nanocavities, also ignoring the manner in which
energy is in-coupled and out-coupled from the system [37, 38]. Recently, we
showed [37] that an electromagnetic modal decomposition of nanoparticle-on-
mirror (NPoM) geometries—specifically the sphere-on-mirror (SoM) and
truncated-sphere-on-mirror (TSoM) shown in Figure 1A—can reveal the plasmonic
modes of the system, and their respective near- and far-field behaviours. This
analysis previously revealed the importance of the NP’s facet size, with
nanometre-scale changes to the facet size drastically impacting both the near-
and far-fields [14, 37, 38]. Even though almost all work so far gas focused on
spherical (or truncated spherical) NPs, during synthesis, NPs most commonly
acquire a polyhedral shape due to the inherent crystalline nature of gold
[32]. When such polyhedral NPs are assembled on a mirror, much more complex
nanocavities are formed whose electromagnetic response (both in the near- and
far-field) is not yet well understood. This is hindering current efforts to
interpret experimental results, map emitter positions within realistic
nanocavity systems, and ultimately control light-matter interactions in such
extreme environments.

In this work, we fully characterize the electromagnetic behaviour of plasmonic
nanocavities formed by commonly occurring polyhedral nanoparticle shapes.
Recent experimental work [32] has revealed that due to the crystaline nature
of gold, gold NPs commonly adopt during their synthesis one of three
polyhedral shapes: (i) cuboctahedron, (ii) rhombicuboctahedron and (iii)
decahedron —as respectively shown in Figure 1B-D. Lossy and open systems such
as these can only be effectively and efficiently described using a quasi-
normal mode (QNM) analysis [39, 40, 41, 42, 43, 44], which decomposes the
plasmonic response into a set of modes with complex eigenfrequencies—where the
real part gives the resonant frequency of the system, and the imaginary part
corresponds to the lossy nature of the mode [45]. We perform such QNM analysis
for all possible plasmonic nanocavities formed when polyhedral nanoparticles
are assembled on a mirror, and reveal that their shape and symmetry dominate
their near- and far-field behaviour. We find that the same NP shape gives very
different results when assembled on the mirror with a different facet, even if
the facet shape and size are identical. We also show that our original
nomenclature for SoM and TSoM configurations introduced in [37] still holds,
despite the lack of spherical symmetry in the polyhedral systems. Through a
recombination technique, the QNM modal far-field responses can be utilised to
obtain the total far-field emission profile for the placement of an emitter at
a specific position within the nanocavity, which is crucial for understanding
how energy couples in and out of the system [27, 38]. This work paves the way
towards controlling at an unprecedented level light-matter interactions in
extreme plasmonic environments, and even determine an emitters position within
a nanocavity and the NP shape with its specific configuration with respect to
the mirror via its far-field emission and resonant frequencies.

##  1 Quasi-Normal Mode Analysis of Plasmonic Nanocavities

Plasmonic nanoantennas are open systems with efficient radiative emission
capabilities that also possess dissipative elements—due to Ohmic losses in the
metal. They are therefore non-Hermitian systems—as energy is not conserved
during electromagnetic oscillations—and cannot be described with the natural
method of normal modes; instead, a QNM description is required which yields
complex eigenfrequecies [43]. In recent years, there have been significant
advancements in the development of quasi-normal analyses for such open and
dissipative nanophotonic environments, with some notable examples being: the
time-domain [46, 47], the pole-search [39, 48, 49], and the auxiliary-field
eigenvalue method [40, 43, 50]. Due to the diverging nature of QNMs [43],
these numerical techniques usually surround the structure with perfectly
matched layers (PMLs) that absorb all the energy emitted to the far-field
[40]. The energy leaking to the far-field needs to be considered when
normalising the QNMs, with a recent review outlining the various methodologies
currently used [41].

In this paper, we use the QNM methodology developed by Lalanne et al. [40, 43,
50], where the auxiliary-fields are used to account for the dispersive
behaviour of the metals and linearise the eigenvalue problem. The QNM
divergence is counteracted through normalisation terms that integrate within
the PML region to include the energy emitted to the far-field. This returns
each QNM’s eigenvector (i.e. electromagnetic near-field vectors) and their
corresponding complex eigenfrequencies (i.e. eigenvalues):
$\tilde{\omega}_{i}=\omega_{i}-i\kappa_{i}$, where the real part
($\omega_{i}$) is the spectral resonant frequency of the QNM and the imaginary
part ($\kappa_{i}$) is the modal linewidth that describes the total losses
attributed to both the radiative and dissipative decay channels of each mode.
This is the same methodology we used in [37] for spherical and truncated-
spherical NPs assembled on mirrors, which is very briefly outlined here, but
discussed in more detail in [40, 43, 50].

In general, the QNMs of the plasmonic system can be found by solving the
source-free Maxwell’s equations for the modal electric
$\tilde{\mathbf{E}}_{i}(\mathbf{r})$ and magnetic
$\tilde{\mathbf{H}}_{i}(\mathbf{r})$ field vectors, which must satisfy the
Sommerfeld radiation condition for outgoing waves. Here, we consider metallic
structures (that have no magnetic optical response) with the electric
permittivity described by an $N$-pole Drude-Lorentz model:

$\varepsilon(\omega)=\varepsilon_{\infty}\left(1+\sum_{k=1}^{N}\frac{\omega_{p,k}^{2}}{\omega_{0,k}^{2}-\omega^{2}-i\gamma_{k}\omega}\right)\
,$ (1)

where $\omega_{p,k}$, $\omega_{0,k}$ and $\gamma_{k}$ are the plasma
frequency, resonant frequency and decay rate of the $k$-th Drude-Lorentz pole,
respectively, and $\varepsilon_{\infty}$ is the asymptotic electric
permittivity. This introduces a non-linearity into the eigenvalue problem, due
to the dependence of the metal optical response on the resonant frequency.
However, the problem can be linearised through the introduction of a pair of
auxiliary fields [40]:

$\tilde{\mathbf{P}}_{i,k}(\mathbf{r})=\frac{\varepsilon_{\infty}\omega_{p,k}^{2}}{\omega_{0,k}^{2}-\tilde{\omega}_{i}^{2}-i\gamma_{k}\tilde{\omega}_{i}}\tilde{\mathbf{E}}_{i}(\mathbf{r})$
(2)
$\tilde{\mathbf{J}}_{i,k}(\mathbf{r})=-i\tilde{\omega}_{i}\tilde{\mathbf{P}}_{i,k}(\mathbf{r})\
,$ (3)

where $\tilde{\mathbf{P}}_{i,k}$ and $\tilde{\mathbf{J}}_{i,k}$ are
respectively the auxiliary polarization and current vectors, which correspond
to the $i^{th}$ QNM and $k^{th}$ Drude-Lorentz pole of the metal. For a two-
pole ($N=2$) Drude-Lorentz model, the linearised system to be solved is given
by:

$\begin{bmatrix}0&-i\mu_{0}^{-1}\nabla\times&0&0&0&0\\\
i\varepsilon_{0}^{-1}\nabla\times&0&0&-i\varepsilon_{\infty}^{-1}&0&-i\varepsilon_{\infty}^{-1}\\\
0&0&0&i&0&0\\\
0&i\omega_{p,1}^{2}\varepsilon_{\infty}&-i\omega_{0,1}^{2}&-i\gamma_{1}&0&0\\\
0&0&0&0&0&i\\\
0&i\omega_{p,2}^{2}\varepsilon_{\infty}&0&0&-i\omega_{0,2}^{2}&-i\gamma_{2}\end{bmatrix}\begin{bmatrix}\tilde{\mathbf{H}}\\\
\tilde{\mathbf{E}}\\\ \tilde{\mathbf{P}}_{1}\\\ \tilde{\mathbf{J}}_{1}\\\
\tilde{\mathbf{P}}_{2}\\\
\tilde{\mathbf{J}}_{2}\end{bmatrix}=\tilde{\omega_{i}}\begin{bmatrix}\tilde{\mathbf{H}}\\\
\tilde{\mathbf{E}}\\\ \tilde{\mathbf{P}}_{1}\\\ \tilde{\mathbf{J}}_{1}\\\
\tilde{\mathbf{P}}_{2}\\\ \tilde{\mathbf{J}}_{2}\end{bmatrix}\ ,$ (4)

where a full description can be found in [40]. This methodology can be
employed using the QNM solver ‘QNMEig’ [44], which is an open-source code
utilizing COMSOL Multiphysics [51] to perform finite-element numerical
eigensolutions of Maxwell equations. This obtains the eigenvalues (complex
resonant frequencies) and eigenvectors (near-field electromagnetic vectors) of
the linearised system shown in (4) [43]. We use this method to obtain the QNM
solutions for the various polyhedral NPs assembled on a flat gold mirror. It
should be noted that the small gap between the NP and the mirror, in
combination with the complicated morphology of the polyhedral NPs increase
enormously the computational cost of such calculations. Additionally to
represent realistic NPs, it is necessary to introduce a curvature to the edges
of each polyhedral nanostructure (discussed in more detail in the Supp.
Info.), which further increases the computational demands of these
calculations.

##  2 Polyhedron-on-Mirror Nanocavities

Figure 2: QNMs of the different nanoparticle-on-mirror structures, for a
characteristic edge length $a$ and spacer thickness $d$. The geometries from
top to bottom are the: circular facet of the TSoM; two square and one
triangular facets of the RhoM; singular square and triangular facets of the
CoM; and the triangular facet of the NDoM. The modes from left to right are:
$(1,0)$, $(1,1)$, $(1,1)$, $(2,2)$, $(2,2)$, $(2,0)$, where the colour
corresponds to the normalised QNM electric fields (Re[$E_{z,lm}$]) on the
$xy$-plane through the centre of their respective cavities.

During the fabrication of gold NPs, the crystalline nature of the metal leads
to the formation of polyhedral shapes: each of which exhibit multiple facets
with various shapes and, when assembled on a mirror, tend to do so with one
facet parallel to the mirror. To date, we have theoretically modelled faceted
NPoM geometries by truncating a perfectly spherical NP to form the TSoM
geometry [37, 33], which assembles on the mirror with a circular facet—as
shown in Figure 1A. To allow comparison with the polyhedral NPoM assemblies
and to introduce the nomenclature used, here we initially perform the QNM
analysis for the TSoM geometry with: NP of radius $r_{p}=40$nm, circular facet
of diameter $f_{d}=20$nm, and spacer of thickness $d=1$nm and refractive index
$n=1.45$. Figure 2 (top row) shows the first six normalised electric field
distributions on a plane through the centre of the nanocavity (and parallel to
the mirror) in order of increasing energy, highlighting the clear mode
confinement within the bounds of the circular facet. The spherical harmonic
nomenclature introduced in [37] for identifying and labelling the set of
supported QNMs is used here, with each QNM labelled according to $i=(l,m)$—for
a set of positive integers $l\geq 1$ and $-l\leq m\leq l$. The nomenclature
shows that all modes with $m=0$ have an anti-node at the centre of the
nanocavity, and all $m\neq 0$ modes have a central node (for more discussion
see [37]). More specifically, the $(1,0)$ mode exhibits a large anti-node,
whereas the pair of $(1,1)$ modes display $2m$-lobed field distributions.
Higher order $m$-modes extend this nature, such as the $4$-lobes of the
$(2,2)$ modes, whereas higher order $l$-modes see a concentric confinement of
the mode within the facet—as shown by the $(2,0)$ mode, with the additional
anti-node ring surrounding the central extrema, compared to the $(1,0)$ mode.
Note that the cylindrical symmetry of the facet means that $(l,|m|)$-mode
pairs are energetically degenerate and their numerically identified
orientation angle is arbitrary, with the only limitation being that the modes
in each pair are orientated orthogonally to each other. To aid the
visualization of the modes’ energetic ordering and degeneracies, we show in
Figure 3 the spectral behaviour of the TSoM modes (top row). Each QNM’s
complex eigenfrequency ($\tilde{\omega}$) obtained from the numerical QNM
calculations is fitted to a Lorentzian (see Methods), such that its resonant
frequency and linewidth are respectively described by $Re\\{\tilde{\omega}\\}$
and $Im\\{\tilde{\omega}\\}$. Note that dashed lines are used to represent
degenerate modes.

Figure 3:  Complex QNM eigenfrequencies represented as Lorentzians, showing
their spectral arrangement and energetic ordering for the: circular facet of
the TSoM; two square and one triangular facets of the RhoM; singular square
and triangular facets of the CoM; and the triangular facet of the NDoM. Dashed
lines represent degenerate QNMs. Vertical dashed lines mark the wavelengths of
(dark green) 775nm and (light green) 900nm.

Here we consider the three most common NP shapes that occur during fabrication
due to the crystalline nature of gold: (a) rhombicuboctahedron, (b)
cuboctahedron, and (c) decahedron—shown in Figure 1, together with scanning
electron microscopy images of realistic gold NPs. Note that the edges of each
polyhedral structure are equal in length. Therefore, instead of a NP radius,
these geometries can be parameterised by their characteristic edge length,
which in this paper are chosen to be $a_{\text{RhoM}}=30$nm,
$a_{\text{CoM}}=8$nm, and $a_{\text{NDoM}}=47$nm for the rhombicuboctahedron,
cuboctahedron and decahedron NPs respectively. These values were chosen such
that their respective $(1,0)$ modes have the same resonant frequency
($Re\\{\tilde{\omega}\\}$), which helps highlight the spectral positioning of
all other modes relative to the $(1,0)$ mode. When these polyhedral NPs are
assembled on a mirror, they yield unique nanocavity systems due to the
multiple distinct facets of each NP that can be assembled onto the mirror (see
Figure 2) [52]. More specifically, the rhombicuboctahedron-on-mirror (RhoM)
system has three unique NP arrangements on the mirror: two square facets, one
with four square neighbouring facets (Sq04) and one with two square and two
triangular neighbours (Sq22); and one triangular facet [38] (see Figure 2).
The cuboctahedron-on-mirror (CoM) system has two unique NP arrangements on the
mirror—one square and one triangular facet—whereas the decahedron NP has ten
identical triangular facets, and therefore only offers a singular unique facet
with which the nanodecahedron-on-mirror (NDoM) can be assembled. For each of
these structures a background material of air is considered, along with the
same spacer of thickness $d=1$nm and refractive index $n=1.45$. To ensure that
our calculations represent realistic systems, we have rounded the edges of the
polyhedral NPs with a curvature of $\rho=1$nm (see Figure S2 for definition).
This means that each facet edge is formed by approximately three gold atoms,
which further increases the computational demands on our calculations. Note
that since each NP’s edge length is different (to allow us to tune their
$(1,0)$ modes), the relative rounding for each NP shape with respect to its
size also differs. A more comprehensive discussion of the edge rounding $\rho$
impact on our results is discussed below and in Supp. Info.

We start with the RhoM geometry assembled on its Sq04 facet (RhoM-Sq04), whose
QNMs are shown in the second row of Figure 2—ordered corresponding to the
modes of the TSoM to aid in their comparison (i.e. they are not energetically
ordered). Although the RhoM-Sq04 nanocavity does not have a cylindrical
symmetry (as the TSoM does), it is apparent that the same spherical harmonic
nomenclature can still be adopted here to adequately identify and describe
these modes. Here the $(1,0)$ mode is distorted to the square shape of the
facet, but retains the same spatial characteristic with a circular central
anti-node, as for the TSoM. Unlike the arbitrary orientation of the TSoM
$(1,1)$ modes, the $(1,1)$ modes of the RhoM-Sq04 preferentially orientate
towards the facet corners, due to the greater charge concentration there. Due
to the four-fold symmetry of the RhoM when assembled on this facet, the
$(1,1)$ modes remain orthogonal and energetically degenerate—similarly to the
TSoM’s $(1,1)$ modes. However, this symmetry causes the two $(2,2)$ modes to
lose their degeneracy (see Figure 3), since one of the $(2,2)$ modes has its
anti-nodes in the corners of the facet—where the charges are more favourably
concentrated—while the second $(2,2)$ mode is orthogonally arranged with its
anti-nodes at the less-confined facet edges, forcing them to loose their
degeneracy. The RhoM-Sq04 $(2,0)$ mode has two concentric anti-nodes that are
more clearly confined to the bounds of the square facet.

The Sq22 facet of the rhombicuboctahedron NP has the same size and shape as
its Sq04 facet, and therefore forms a geometrically identical nanocavity when
assembled on the mirror (RhoM-Sq22). One can therefore easily assume that the
QNMs in the gap of the RhoM-Sq22 system would be identical to those of the
RhoM-Sq04 nanocavity. However, the RhoM-Sq22 system carries a two-fold
symmetry due to the pair of triangular facets neighbouring the Sq22 facet—as
indicated by the small black triangles in the RhoM-Sq22 inset of Figure 2.
These triangular facets lie at an inter-facet angle slightly closer to the
mirror compared to the neighbouring square facets, which increases the field
confinement along the edges adjacent to them. This creates an effectively
elongated facet due to an unequal charge confinement supplied by the
neighbouring square and triangular facets. Although the $m=0$ modes are
largely unchanged compared to the RhoM-Sq04 modes, the broken geometrical
symmetry of the RhoM-Sq22 nanocavity has a significant impact on the rest of
the modes. For example, the pair of $(1,1)$ modes reorientate to instead align
with the sides of the facet rather than the corners—preserving their
orthogonality. The unequal charge confinement across the facet breaks the
degeneracy of the $(1,1)$ modes (see Figure 3), with the mode directed between
the neighbouring two triangular facets being more energetically favourable.
Interestingly, the $(2,2)$ modes retain their orientations compared to their
RhoM-Sq04 counterparts, but due to the unequal charge confinement between the
edges and corners of the Sq22 facet, the second $(2,2)$ mode loses its central
node—with significant consequences to the far-field emission, as discussed
later. Note that for a larger edge rounding, this ‘effective’ elongation is
much more profound, with a visible stretching of the $(2,0)$ mode and more
pronounced loss of the second $(2,2)$ mode’s central node. Figure S3 compares
the near-fields modes of the RhoM-Sq22 with $1$nm and $5$nm rounding, with
additional discussion in the Supporting Information.

The final unique orientation of the RhoM geometry sees the assembly of the NP
on its triangular facet (RhoM-Tri). Although the morphology of this facet is
significantly different to both the circular and square facets seen so far,
the same spherical harmonic nomenclature applies for its QNMs. The $(1,0)$
mode is clearly identifiable, with a single central anti-node confined to the
bounds of the triangular facet. Due to the mismatch between the two lobes of
the $(1,1)$ modes and the three-fold symmetry of RhoM-Tri system, the $(1,1)$
modes are less energetically favourable than the $(1,0)$ mode; however, they
remain orthogonal to each other and are energetically degenerate (see Figure
3). Similarly, the $(2,2)$ modes remain degenerate, but the three-fold
symmetry of the geometry alters the charge distributions such that the nodal
lines do not cross. The $(2,0)$ mode now exhibits stronger fields
concentrations in the three corners of thee facet, but otherwise remains
unchanged. Even though we have so far discussed the nanocavities formed by
just one polyhedral NP shape (the rhombicuboctahedron), the formation of three
distinct nanocavities have been identified—each exhibiting a different optical
response.

We next consider the cuboctahedron NP assembled on the mirror, which can
create nanocavities with either a square or triangular facet. When assembled
on its square facet (CoM-Sq), it has the same facet shape and four-fold
symmetry as the RhoM-Sq04, and supports an almost identical set of QNMs—with
energetically degenerate $(1,1)$ modes and spectrally split $(2,2)$ modes.
When instead assembled on the mirror with its triangular facet (CoM-Tri), the
facet shape and three-fold symmetry of the CoM-Tri geometry leads to a very
similar set of QNMs as those supported by the RhoM-Tri. Note that the edge
length of the cuboctahedron NP is $a_{CoM}=8$nm, which is much smaller than
the edge length of the rhombicuboctahedron NP ($a_{RhoM}=30$nm). The edge
length dictates the frequency regime in which the modes appear, and for this
paper the edge lengths were chosen such that each system’s $(1,0)$ mode has
the same resonant frequency (see Figure 3). However, since the rounding was
kept at the same $\rho=1$nm for each structure, there is softer charge
confinement at the edges of the CoM facets. The smaller facet areas and
proportionally larger rounding (with respect to the edge length) of the CoM
leads to much less pronounced QNM field confinements. For further discussion
see Supporting Information, where the CoM geometry with edge lengths of
$a_{CoM}=8$nm and $a_{CoM}=20$nm are compared.

Finally, we consider the decahedral NP assembled on a mirror (the NDoM system)
that has ten identical triangular facets, allowing for a single unique facet
assembly on the mirror (see Figure 2). The slanting of the decahedral NP leads
to a strong asymmetry in the field confinement across the facet, with the
black triangle in the inset of Figure 2 (bottom row) indicating the corner of
the facet that sits underneath the NP centroid and receives the weakest
confinement. This unequal field confinement leads to an ‘effective’ facet
centre that lies slightly closer to the corner under the NP, instead of the
equilateral triangular facet’s centre. This distorts the set of QNMs supported
by the NDoM nanocavity, compared to those observed for the RhoM-Tri and CoM-
Tri geometries. The $(1,0)$ mode is most affected by this asymmetry and
‘effective’ facet centre, which appears to push the charge distributions
towards the corner under the NP—so much so that additional concentric anti-
nodes appear. A similar behaviour is observed for higher order $m=0$ modes,
with the $(2,0)$ mode changing profile significantly. Although the $(1,1)$
modes appear similar to those of the RhoM-Tri and CoM-Tri, the unequal
confinement across the facet leads to the loss of their degeneracy and a large
spectral separation (see Figure 3). Due to the form of the $(2,2)$ modes,
however, they are negligibly affected by this weakly confined corner
underneath the NP and are only very slightly non-degenerate.

##  3 Far-Field Emission Profiles

Having obtained the QNMs and complex eigenfrequencies of these polyhedron-on-
mirror nanocavities—observing their near-field resonances and optical
responses—we now explore how each nanocavity out-couples energy to the far-
field. We perform a NFFT for the QNM near-fields shown in Figure 2, in order
to obtain the far-field Poynting flux. We use the software RETOP [53, 54],
which is designed to implement NFFTs for stratified media with dispersive
elements [37, 55, 56, 57]—such as the nanocavities discussed here. The QNM
electric $\tilde{\mathbf{E}}_{lm}(\mathbf{r})$ and magnetic
$\tilde{\mathbf{H}}_{lm}(\mathbf{r})$ fields of each $(l,m)$ mode are
considered on a region enclosing the NP, ensuring that it intersects all
material layers of the system: in our case this is the mirror, spacer and air
domains. These near-fields
$(\tilde{\mathbf{E}}_{lm}(\mathbf{r}),\tilde{\mathbf{H}}_{lm}(\mathbf{r}))$
are projected to the far-field
($\tilde{\mathbf{E}}^{ff}_{lm},\tilde{\mathbf{H}}^{ff}_{lm}$)$e^{i\omega_{em}R/c}$
on a hemispherical dome of radius $R=1$m above the NPoM geometry, at a
frequency $\omega_{em}$. From these far-fields, the time-average Poynting flux
$\langle S_{lm}\rangle=\text{Re}[\tilde{\mathbf{E}}^{ff\
*}_{lm}\times\tilde{\mathbf{H}}^{ff}_{lm}]/2$ is calculated for each $(l,m)$
mode as a function of the polar ($\theta$) and azimuthal ($\phi$) angles of
the dome, where the polar angle is zero at the top of the dome.

The far-field emission patterns are shown in Figure 4, where the time-averaged
Poynting fluxes $\langle S_{lm}\rangle$ are plotted for each of the structure
discussed above—with each mode corresponding to their near-field counterpart
in Figure 2. We initially show the far-field emission patterns for the TSoM
geometry—with its cylindrically symmetric circular facet—that have previously
been discussed in [37]. All $m=0$ modes emit in a conical shape—with the
maximum energy emitted at $\theta=62^{\circ}$ [24, 58, 59]—whereas the pair of
$(1,1)$ modes largely emit normally away from the mirror, with smaller
contributions following their near-field lobes (as shown by the white dashed
lines). All other $m>1$ modes exhibit $2m$-lobes of equal intensity, emitted
conically away from the mirror at the same angle of $\theta=62^{\circ}$. Each
pair of $m\neq 0$ modes retain their orthogonality in the far-field, as well
as the directionality of their near-field counterparts.

It should be noted that the NFFT used to obtain the far-field emissions in
Figure 4 is extremely sensitive to minute numerical errors in the
electromagnetic fields
$(\tilde{\mathbf{E}}_{lm}(\mathbf{r}),\tilde{\mathbf{H}}_{lm}(\mathbf{r}))$
obtained from the numerical QNM calculations—with increasingly finer meshing
required for higher order modes. For this reason, the $(3,3)$ TSoM mode does
not emit normally away from the mirror as we previously reports in [37], but
in fact has six conically emitting lobes (see Supp. Info.). The different lobe
intensities are also due to numerical errors from the QNM calculations. It was
computationally too expensive to distinguish the far-field lobes for modes of
$m>3$.

Figure 4: Far-field emission for the QNMs of the different particle-on-mirror
structures, for a characteristic side length $a$ and spacer thickness $d$. The
geometries from top to bottom: circular facet of the TSoM; two square and one
triangular facets of the RhoM; singular square and triangular facets of the
CoM; and the triangular facet of the NDoM. The modes from left to right:
$(1,0)$, $(1,1)$, $(1,1)$, $(2,2)$, $(2,2)$, $(2,0)$, where the colour
corresponds to the normalised time averaged Poynting flux $\langle
S_{lm}\rangle$. White dashed lines are added over the $(1,1)$ modes to
highlight the correspondence of their direction and orthogonality with their
near-field counterparts.

Returning to the polyhedron-on-mirror nanocavities discussed above, the far-
field emission patterns are shown in Figure 4 in which we explore the effects
of morphological facet intricacies and geometrical symmetries—as observed in
each mode near-field charge distribution. All $m=0$ modes emit with a conical
shape and have a maximum emission angle of $\theta=62^{\circ}$, regardless of
the nanocavity morphology. The $(1,1)$ modes are similarly consistent across
all nanocavities, emitting largely normally to the mirror but also with
smaller contributions that align with the near-field lobes of each
mode—therefore preserving the orthogonality between each mode pair; the only
difference between the $(1,1)$ modes of each nanocavity system is the
azimuthal orientation of their far-field emissions.

Similarly, the $(2,2)$ modes mostly retain their four-lobed emission patterns
for nanocavities formed with a square facet (i.e. RhoM-Sq04, RhoM-Sq22, CoM-
Sq), and again closely follow their near-field distributions. A notable
exception is the second $(2,2)$ mode of the RhoM-Sq22 nanocavity, whose near-
field appears elongated due to the more shallow inclination of the
neighbouring triangular facets compared to the neighbouring square
facets—which breaks the four-fold symmetry of the facet. As discussed earlier,
this ‘effective’ elongation of the facet destroys the node at the centre of
the second $(2,2)$ mode, which now experiences a non-zero $E_{z}$-field. This
has the remarkable ability to completely dominate the emissive response of the
system, which instead acquires a more conical far-field emission—with the peak
intensity at the same $\theta=62^{\circ}$. By increasing the edge rounding
from $\rho=1$nm to $\rho=5$nm, the far-field profile becomes almost identical
to an $m=0$ mode (as shown in Figure S3). Additionally, the second $(2,2)$
mode of the CoM-Sq nanocavity appears to be an exception to the general four-
lobed emission of most $(2,2)$ modes. However, the unconventional far-field
emission of this mode is due to the small size of the NP ($a_{CoM}=8$nm),
which leads to a relatively large fractional rounding of the edges and a non-
ideal confinement of the fields within the nanocavity. If one increases the
edge length of the cuboctahedron NP to $a_{CoM}=20$nm, this mode regains its
four-lobe far-field emission (see Supp. Info. Figure S4 for more discussion).

Although the $m=0$ and $(1,1)$ modes of nanocavities formed with triangular
facets retain the same far-field emissions as the TSoM nanocavity, the $(2,2)$
modes lose their four-lobed emission. Interestingly, they instead emit
normally away from the mirror and now very similarly to the extended single
anti-node of $(1,1)$ modes—with almost identical far-field patterns observed
for both the RhoM-Tri and CoM-Tri nanocavities. This is due to the four-fold
symmetry of the TSoM’s $(2,2)$ modes ‘squeezed’ within a triangular facet (see
Figure 2), which destroys its four-fold symmetry. Instead, the ‘overall’ far-
field response is now dominated by the dipoles that form between the anti-
nodes of the near-field charge distributions which posses opposite signs; this
results in far-field emissions that are very similar to $(1,1)$ modes, whose
directionality is dictated by these anti-node dipoles (see Figure 2)—still
retaining their mode orthogonalities.

Furthermore, the NDoM geometry—that only creates triangular nanocavities—also
exhibits different far-field emissions for the $(2,2)$ modes. The decahedral
NP assembled on the mirror creates an asymmetric geometry that causes unequal
confinement across the triangular facet; this effectively shifts the centre of
the facet closer to the corner of the facet that sits underneath the NP
(indicated with a black triangle in Figure 4) and adds an ‘effective’
elongation to the near-fields of both the $(2,2)$ modes. This causes the near-
fields of the second $(2,2)$ mode to resemble the first $(1,1)$ mode, and
therefore emit to the far-field in a similar manner—normally away from the
mirror. The first $(2,2)$ mode behaves similarly, but additionally loses its
central lobe in the near-field; its far-field emission is therefore a
superposition of a conical emission (similar to $m=0$ modes) and a normal
emission (similar to a $(1,1)$ mode). Finally, this ‘effective’ elongation of
the facet impacts the far-field emission of the $(2,0)$ mode which, although
still conical, is now asymmetric—with higher intensity along the azimuthal
angle that aligns with the ‘effective’ centre of the triangular facet.

Although some modes appear unaffected by the large geometrical differences
between these nanocavities, the far-field profiles of other modes show an
extraordinarily strong dependence on the exact morphology of the facet and the
symmetry of the overall system. The far-field emissions of these polyhedral
NPoM geometries are crucial for understanding how each mode couples energy out
of the cavity to reach the far-field, however, one cannot excite QNMs
individually since their spectra overlap. For example, an emitter in the
cavity couples to many modes, forming an overall optical response that is
dependent on both the spatial and spectral properties of each mode and the
emitter. Therefore, to calculate the total optical response of a system—and
its overall far-field emission—the collective response of all the QNMs must be
considered. This is given by [37, 43]:

$\\{\tilde{\mathbf{E}}(\mathbf{r}),\tilde{\mathbf{H}}(\mathbf{r})\\}=\sum_{lm}\alpha_{lm}(\mathbf{r}_{em},\omega_{em})\\{\tilde{\mathbf{E}}_{lm}(\mathbf{r}),\tilde{\mathbf{H}}_{lm}(\mathbf{r})\\}\
,$ (5)

where
$\\{\tilde{\mathbf{E}}_{lm}(\mathbf{r}),\tilde{\mathbf{H}}_{lm}(\mathbf{r})\\}$
are the electromagnetic near-fields of mode $(l,m)$,
$\\{\tilde{\mathbf{E}}(\mathbf{r}),\tilde{\mathbf{H}}(\mathbf{r})\\}$ are the
total fields and $\alpha_{lm}(\mathbf{r}_{em},\omega_{em})$ is the excitation
coefficient of mode $(l,m)$—dependent on both the position of the emitter
$\mathbf{r}_{em}$ and its resonant frequency $\omega_{em}$. These modal
excitation coefficients are given by [43]:

$\displaystyle\alpha_{lm}(\mathbf{r}_{em},\omega_{em})=-\omega\sum_{l^{\prime}m^{\prime}}B^{-1}_{lm,l^{\prime}m^{\prime}}(\omega_{em})\mathbf{\mu}_{em}\cdot\tilde{\mathbf{E}}_{l^{\prime}m^{\prime}}(\mathbf{r}_{em})\
,$ (6)

where $\mathbf{\mu}_{em}$ is the dipole moment of the emitter, and the term
$B_{lm,l^{\prime}m^{\prime}}(\omega)$ is a matrix constructed as [37, 43]:

$\displaystyle
B_{lm,l^{\prime}m^{\prime}}(\omega)=\iiint_{\Omega}\tilde{\mathbf{E}}_{l^{\prime}m^{\prime}}\cdot\left[\omega\varepsilon(\mathbf{r},\omega)-\tilde{\omega}_{lm}\varepsilon(\mathbf{r},\tilde{\omega}_{lm})\right]\tilde{\mathbf{E}}_{lm}-\mu_{0}\tilde{\mathbf{H}}_{l^{\prime}m^{\prime}}\cdot\left(\omega-\tilde{\omega}_{lm}\right)\tilde{\mathbf{H}}_{lm}\
d\mathbf{r}^{3}\ ,$ (7)

which, for each of the systems considered here, includes twenty modes. We have
found (from this and previous [37] studies) that twenty modes are more than
enough to describe the overall behavour of the system. This is due to higher-
order modes being increasingly more confined on the metal-dielectric
interfaces and with almost identical resonant frequencies, which one can
approximate to a collective mode response, commonly referred to as the
‘pseudo-mode’ [60]. The total far-field emission of each structure is related
to its modal components, using the same set of $\alpha$-coefficients, as [37,
43]:

$\\{\tilde{\mathbf{E}}^{ff}(\mathbf{r}),\tilde{\mathbf{H}}^{ff}(\mathbf{r})\\}=\sum_{lm}\alpha_{lm}(\mathbf{r}_{em},\omega_{em})\\{\tilde{\mathbf{E}}^{ff}_{lm}(\mathbf{r}),\tilde{\mathbf{H}}^{ff}_{lm}(\mathbf{r})\\}\
.$ (8)

The total time-average Poynting flux in the far-field is therefore given by
$\langle S_{tot}\rangle=\text{Re}[\tilde{\mathbf{E}}^{ff\
*}\times\tilde{\mathbf{H}}^{ff}]/2$, and is dependent on both the transition
frequency $\omega_{em}$ of the emitter, and its position within the nanocavity
$\mathbf{r}_{em}$ [37]. By determining the $\alpha$-coefficients, the total
far-field emission pattern for each polyhedral structure excited by a dipole
source within the nanocavity can therefore be identified through the
recomposition of each modal emission profile. The resonant frequency of the
emitter $\omega_{em}$ determines which of the nanocavity’s modes will be
excited. By consulting the spectral arrangement and localisation of each
structure’s modes (as shown in Figure 3), we identify two interesting
frequencies for a dipole emitter—one either side of the $(1,0)$ mode
resonance—at $\lambda_{em}=775$nm and $\lambda_{em}=900$nm, respectively shown
as dark and light green vertical dashed lines. These dipole frequencies are
chosen to highlight how the $\alpha$-coefficients and far-field emissions
change as different modes are excited in the system, as well as how the
position of the emitter changes the behaviour.

Figure 5: $\alpha$-coefficients of the polyhedral NPoM geometries, for a
series of emitter positions within the nanocavities. Column A - The triangular
facets of the polyhedral systems, following a path from perpendicular line
drawn from one of the facet edges to the opposite corner, through the
triangular facet centroid—normalised to the total length of this parth
($h=\sqrt{3}a/2$). Column B - The square facets of the polyhedral systems,
following a path along the $x$-axis from the centre of the facet. Column C -
The square facets of the polyhedral systems, following a path along the
diagonal from the centre of the facet. White and blue backgrounds respectively
correspond to emitter transition wavelengths of $\lambda_{em}=775$nm and
$\lambda_{em}=900$nm.

We start with the nanocavities formed of triangular facets (i.e. CoM-Tri,
RhoM-Tri, NDoM-Tri), and plot the $\alpha$-coefficients for a series of
emitter positions $P$ across the length $h$ of the perpendicular line drawn
from one of the facet edges to the opposide corner passing through the
equilateral triangular facet’s centroid (or ortho-centre) —as shown atop
Figure 5 Column A, and specifically for each nanocavity in the insets of
Figure 6—on a plane halfway between the NP facet and the mirror. To ensure
consistency between our results for each system, the orientation of the path
is chosen to follow the nodal line of the first $(1,1)$ mode’s near-field.
Note that $P$ is measured relative to the centre of the equilateral triangular
facet, and that figures with white (blue) backgrounds show the
$\alpha$-coefficients for a dipole emitter resonant at $\lambda_{em}=775$nm
($\lambda_{em}=900$nm). More results are shown in Supp. Info. Figure S5.

For the CoM-Tri nanocavity at $\lambda_{em}=775$nm, an emitter at the centre
of the facet coincides with the anti-nodes of $m=0$ modes (note $m\neq 0$
modes have no fields) which therefore dominate the $\alpha$-coefficients. In
the negative region of the path $P/h<0$ (i.e. towards the middle of the facet
edge), the $\alpha$-coefficients of the second $(1,1)$ and $(2,2)$ modes
increase, since this is the region where their near-field anti-nodes exist.
Similarly, when the emitter is placed near the triangle facet corner
($P/h>0$), the second $(1,1)$ mode further dominates due to its stronger near-
fields. These values of the $\alpha$-coefficients dominate the overall far-
field emission profile of the CoM-Tri nanocavity, which is shown in Figure 6
(top row) for the different positions of the dipole emitter. For $P/h<0$ the
$m=0$ modes emit relatively efficiently, in addition to the second $(1,1)$ and
$(2,2)$ modes; together these produce a conical far-field emission with an
asymmetry due to the primary coupling on one side of the second $(1,1)$ and
$(2,2)$ modes. Similarly for an emitter placed along the positive $P/h>0$
direction, gradually the second $(1,1)$ and $(2,2)$ modes dominate, producing
a far-field emission focused towards a specific solid angle. By contrast, for
an emitter of $\lambda_{em}=900$nm, the $\alpha$-coefficients of the $(1,0)$
mode completely dominate the rest of the modes (see Figure 5) and therefore
the far-field emission too (Figure 6, bottom row)—with the $(1,1)$ mode only
interfering with the $(1,0)$ mode once the emitter reaches the corner of the
triangular facet. Similarly for the RhoM-Tri nanocavity, emitting at
$\lambda_{em}=775$nm the $(1,0)$ mode dominates, evident from the
$\alpha$-coefficient values (see Figure 5) and the far-field emissions (Figure
6 \- third row). Again the second $(1,1)$ mode interferes with the emission of
the $(1,0$ mode only when the emitter is placed at the corner of the
triangular facet.

Figure 6: Reconstructed total far-field emission of the different particle-on-
mirror structures, for a series of emitter positions within the nanocavities.
The geometries are the CoM, NDoM and RhoM structures assembled on their
triangular facets, with the colour corresponding to the normalised time
averaged total Poynting flux $\langle S_{tot}\rangle$. The emitter positions
follow a path $P$ from the perpendicular line drawn from one of the facet
edges to the opposite corner of the triangle facet, through its centroid—and
is shown normalised to the length of this path ($h=\sqrt{3}a/2$). White and
blue backgrounds respectively correspond to emitter transition wavelengths of
$\lambda_{em}=775$nm and $\lambda_{em}=900$nm, and the dark red border
represents the relative rounding region of the facet edge with respect to the
facet size (i.e. $\rho/a$) of each nanocavity.

In contrast to CoM-Tri and RhoM-Tri nanocavities, the NDoM (that only forms
triangular nanocavities) shows a very intriguing behaviour. The
$\alpha$-coefficients show contributions from the $m=0$ modes, but a
negligibly small contribution from the $(1,1)$ modes, across the entire path
of the emitter—it is instead dominated by the first $(2,2)$ mode (see Figure
5). This is also reflected in the far-field emission patterns (see Figure 6,
second row), where the first $(2,2)$ mode primarily contributes. When the
emitter is positioned at $P=2h/9$, the $\alpha$-coefficient of the first
$(2,2)$ mode becomes comparable in value with the second $(1,1)$ mode as well
as the $m=0$ modes, which increases the asymmetry in the otherwise conical
far-field emission. However, the first $(2,2)$ mode dominates most of the far-
field emission, regardless of the emitter’s position, and always exhibiting a
‘horse-shoe’ emission pattern. It should be noted that the asymmetry of the
decahedron NP induces an ‘effective’ facet centre that is different to the
geometrical centre ($P/h=0$) of the triangular facet (as discussed earlier),
which is clearly evident from the $\alpha$-coefficient of the $(1,0)$ mode
that peaks at $P/h\sim 0.12$.

We also perform a similar study for nanocavities formed with square facets
(i.e. CoM-Sq, RhoM-Sq04, RhoM-Sq22). Due to the differing arrangements of the
modes’ near-fields within these square nanocavities, two paths for the emitter
positions are taken for each facet assembly. Both start at the centre of the
facet, with one path tracing horizontally towards the facet edge (i.e. along
the x-axis)—see Figure 5, Column B—and the other diagonally to the facet
corner (see Figure 5, Column C).

We start with the CoM-Sq nanocavity for an emitter of wavelength
$\lambda_{em}=775$nm. In Figure 5 we see that the $m=0$ modes are dominant for
an emitter at the centre of the facet—as expected from their near-field
profiles—but as we move towards the facet edge (corner), we see that the
second (first) $(2,2)$ mode dominates. This is also evident from the far-field
emissions shown in Figure 7 (first and second rows). When the emitter is at
the centre of the facet, a conical emission is observed (coming from the $m=0$
modes), but as the emitter approaches the facet edge or corner, one of the
$(2,2)$ modes dominates the far-field emission. Note that the stronger
excitation of the $(2,0)$ at the corners of the square facet leads to a more
conical far-field emission when the emitter is placed closer to the corners of
the square facet. If now we consider an emitter resonant at
$\lambda_{em}=900$nm moving along the same paths within the CoM-Sq nanocavity,
we observe a very different behaviour. At this wavelength, an emitter very
efficiently couples into the $(1,1)$ modes and somewhat efficiently into the
$(1,0)$ mode—as the $\alpha$-coefficients show in Figure 5. The $(1,1)$ modes
dominate the far-field emission of the system as the emitter moves away from
the facet centre—as shown in Figure 7, bottom two rows. The unequal amplitudes
of the two $(1,1)$ modes is due to the orientation of each mode’s near-fields
that does not fully align with the corners (or the edges) of the square facet.
This is primarily due to the small size of the NP and relatively large
curvature (i.e. the field confinement in the gap is not perfect).

Figure 7: Reconstructed total far-field emission of the different particle-on-
mirror structures, for a series of emitter positions within the nanocavities.
The geometries are the CoM and RhoM structures assembled on their square
facets, with the colour corresponding to the normalised time averaged total
Poynting flux $\langle S_{tot}\rangle$. For each structure, two emitter paths
are considered: one from the centre of the facet to the edge, along the
$x$-axis; and the other from the centre of the facet to the corner, along the
diagonal. White and blue backgrounds respectively correspond to emitter
transition wavelengths of $\lambda_{em}=775$nm and $\lambda_{em}=900$nm.

Finally, we consider the RhoM-Sq04 nanocavity for an emitter of
$\lambda_{em}=900$nm, again moving from the centre of the square facet along
either horizontal or diagonal paths. The $\alpha$-coefficients (see Figure 5)
show that the $(1,0)$ mode dominates, with both $(1,1)$ modes increasing as
the emitter moves horizontally, and only the second $(1,1)$ mode increasing as
the emitter moves diagonally towards the facet corner. This behaviour is also
reflected in the far-field emission patterns shown in Figure 7 (third and
fourth rows), where an emitter at the centre of the square facet produces a
perfect conical emission, but an asymmetric emission emerges as the emitter
moves away from the centre. Note that the direction of the far-field emission
asymmetry follows the position of the emitter within the nanocavity. The RhoM-
Sq22 geometry shares strong similarities in facet shape and spectral
arrangements to the RhoM-Sq04 nanocavity, and therefore has a nearly identical
set of $\alpha$-coefficients (see Figure 5) and far-field emission patterns.
The only distinct difference is that the $(1,1)$ modes of RhoM-Sq22 align with
the edges of the square facet instead of the corners (as it does for the RhoM-
Sq04 nanocavity), and therefore the $\alpha$-coefficient values for the
horizontal and diagonal paths of the emitter are switched compared to those of
the RhoM-Sq04 nanocavity.

Hence, the $\alpha$-coefficients and far-field emission patterns of these
polyhedron-on-mirror nanocavities reveal a rich and intricate optical response
that is highly dependent on the modes’ near-field and spectral properties, as
well as the emitter frequency and position within each nanocavity. In general,
the $\alpha$-coefficients follow the intensities of the corresponding near-
fields of each mode: the only exception being the $(2,0)$ mode for the RhoM
assemblies, which does not strongly respond to the emitter’s positioning
within the nanocavity (for the emitter transition wavelengths chosen here).
Note that for each nanocavity and emitter path, the edge rounding leads to a
reduction in the $\alpha$-coefficient values, but of varying degree depending
on the confinement and localisation of each mode to the facet edge/corner, and
the rounding size relative to each NP’s edge length. The results presented in
this paper are essential for identifying which modes are significant during
the interactions of emitters placed within realistic nanocavities. It also
paves the way towards determining the exact position of an emitter within a
nanocavity by simply recording the system’s far-field emission pattern.

##  4 Conclusion

Gold spherical nanoparticles acquire various polyhedral shapes during their
synthesis, due to the crystalline nature of gold. Here, using a quasi-normal
mode analysis on nanocavities formed by the three most commonly occurring
polyhedral nanoparticles (i.e. cuboctahedron, rhombicuboctahedron, decahedron)
and assembled on a flat mirror, we show the rich multi-modal nature of their
optical responses. This optical behaviour is dominated by the geometrical
morphology of the nanogap and its neighbouring facets, as well as the the
symmetry of the overall system. The far-field emission from each nanocavity
shows the morphological-dependent intricacies with which the system is able to
out-couple energy, in addition to the extraordinarily strong dependence on the
emitter’s resonant frequency and position within the nanocavity. Our work
provides information on how emitters in realistic nanocavities interact with a
set of plasmonic modes, and the manner in which the system facilitates the
out-coupling of energy to the far-field where it can be measured
experimentally. Hence, it enables the direct comparison with experimental
measurements and therefore significantly aids the interpretation and control
of light-matter interactions in extreme plasmonic environments.

## Methods

### Optical Properties of Gold

For each of the structures and facet orientations considered here, the QNM
simulations see the polyhedral NP and spacer placed at the bottom of a
cylindrical domain with a height and radius of $250$nm. This cylinder has
$150$nm thick PMLs placed on top and around the sides, with a $100$nm thick
substrate set beneath it. The gold NP and substrate in each system are modeled
by a $2$-pole Drude-Lorentz electric permittivity. This reduces the general
expression of equation 1 to:

$\varepsilon(\omega)=\varepsilon_{\infty}\left(1+\frac{\omega_{p,1}^{2}}{\omega_{0,1}^{2}-\omega^{2}-i\gamma_{1}\omega}+\frac{\omega_{p,2}^{2}}{\omega_{0,2}^{2}-\omega^{2}-i\gamma_{2}\omega}\right)\
,$ (9)

where $\varepsilon_{\infty}=6\varepsilon_{0}$, $\omega_{p,1}=5.37\times
10^{15}$ rad/s, $\omega_{0,1}=0$ rad/s, $\gamma_{1}=6.216\times 10^{13}$
rad/s, $\omega_{p,2}=2.2636\times 10^{15}$ rad/s, $\omega_{0,2}=4.572\times
10^{15}$ rad/s, and $\gamma_{2}=1.332\times 10^{15}$ rad/s. This is indirectly
implemented into the numerical model via the pair of auxiliary fields for each
pole.

### Lorentzian Fits to QNMs

For the spectral representation of each system’s modal distribution in Figure
3, the real ($\omega_{i}$) and imaginary ($\kappa_{i}$) components of each
QNM’s eigenfrequency are fitted to a Lorentzian, as follows:

$L(\omega)=\frac{(\kappa_{i}/2)^{2}}{(\kappa_{i}/2)^{2}+(\omega-\omega_{i})^{2}}\
,$ (10)

where $\kappa_{i}$ corresponds to the full-width half-maximum.

## Acknowledgements

AD gratefully acknowledges support from the Royal Society University Research
Fellowship URF\R1\180097, Royal Society Research Fellows Enhancement Award RGF
\EA\181038, Royal Society Research grants RGS \R1\211093 and funding from
EPSRC for the CDT in Topological Design EP/S02297X/1. J.J.B. acknowledges
EPSRC Grants EP/N016920/1, EP/L027151/1, NanoDTC EP/L015978/1, and support
from European Research Council (ERC) under Horizon 2020 research and
innovation programme THOR 829067, POSEIDON 861950, and PICOFORCE 883703.

## References

  * [1] Marek Grzelczak, Jorge Perez-Juste, Paul Mulvaney, and Luis M. Liz-MarzÃ¡n.  Shape control in gold nanoparticle synthesis.  Chemical Society Reviews, 37:1783–1791, 2020.
  * [2] Luis M. Liz-MarzÃ¡n.  Nanometals: Formation and color.  Materials Today, 7:26–31, 2004.
  * [3] Jing Jiang, Xinhao Wang, Shuang Li, Fei Ding, Nantao Li, Shaoyu Meng, Ruifan Li, Jia Qi, Qingjun Liu, and Gang Logan Liu.  Plasmonic nano-arrays for ultrasensitive bio-sensing.  Nanophotonics, 7:1517–1531, 2018.
  * [4] Bart de Nijs, Cloudy Carnegie, Istvan Szabo, David-Benjamin Grys, Rohit Chikkaraddy, Marlous Kamp, Steven J. Barrow, Charlie A. Readman, Marie-Elena Kleemann, Oren A. Scherman, Edina Rosta, and Jeremy J. Baumberg.  Inhibiting Analyte Theft in Surface-Enhanced Raman Spectroscopy Substrates: Subnanomolar Quantitative Drug Detection.  ACS Sensors, 4:2988–2996, 2019.
  * [5] Emiliano CortÃ©s, Lucas V. Besteiro, Alessandro Alabastri, Andrea Baldi, Giulia Tagliabue, Angela Demetriadou, and Prineha Narang.  Challenges in Plasmonic Catalysis.  ACS Nano, 14:16202–16219, 2020.
  * [6] Wei Li and Jason G. Valentine.  Harvesting the loss: surface plasmon-based hot electron photodetection.  Nanophotonics, 6:177–191, 2017.
  * [7] N. C. Panoiu, W. E. I. Sha, D. Y. Lei, and G.-C. Li.  Nonlinear optics in plasmonic nanostructures.  Journal of Optics, 20:083001, 2018.
  * [8] Felix Benz, Christos Tserkezis, Lars O. Herrmann, Bart de Nijs, Alan Sanders, Daniel O. Sigle, Laurynas Pukenas, Stephen D. Evans, Javier Aizpurua, and Jeremy J. Baumberg.  Nanooptics of molecular-shunted plasmonic nanojunctions.  Nano Letters, 15(1):669–674, 2015.
  * [9] Bart de Nijs, Richard W. Bowman, Lars O. Herrmann, Felix Benz, Steve J. Barrow, Jan Mertens, Daniel O. Sigle, Rohit Chikkaraddy, Anna Eiden, Andrea Ferrari, Oren A. Scherman, and Jeremy J. Baumberg.  Unfolding the contents of sub-nm plasmonic gaps using normalising plasmon resonance spectroscopy.  Faraday Discuss., 178:185–193, 2015.
  * [10] Daniel O. Sigle, Jan Mertens, Lars O. Herrmann, Richard W. Bowman, Sandrine Ithurria, Benoit Dubertret, Yumeng Shi, Hui Ying Yang, Christos Tserkezis, Javier Aizpurua, and Jeremy J. Baumberg.  Monitoring morphological changes in 2D monolayer semiconductors using atom-thick plasmonic nanocavities.  ACS Nano, 9(1):825–830, 2015.
  * [11] Felix Benz, Mikolaj K. Schmidt, Alexander Dreismann, Rohit Chikkaraddy, Yao Zhang, Angela Demetriadou, Cloudy Carnegie, Hamid Ohadi, Bart de Nijs, Ruben Esteban, Javier Aizpurua, and Jeremy J. Baumberg.  Single-molecule optomechanics in “picocavities”.  Science, 354(6313):726–729, 2016.
  * [12] Alexandros Emboras, Jens Niegemann, Ping Ma, Christian Haffner, Andreas Pedersen, Mathieu Luisier, Christian Hafner, Thomas Schimmel, and Juerg Leuthold.  Atomic Scale Plasmonic Switch.  Nano Letters, 16(1):709–714, 2016.
  * [13] Jan Mertens, Anna L. Eiden, Daniel O. Sigle, Fumin Huang, Antonio Lombardo, Zhipei Sun, Ravi S. Sundaram, Alan Colli, Christos Tserkezis, Javier Aizpurua, Silvia Milana, Andrea C. Ferrari, and Jeremy J. Baumberg.  Controlling Subnanometer Gaps in Plasmonic Dimers Using Graphene.  Nano Letters, 13(11):5033–5038, 2013.
  * [14] J. Mertens, A. Demetriadou, R. W. Bowman, F. Benz, M.-E. Kleemann, C. Tserkezis, Y. Shi, H. Y. Yang, O. Hess, J. Aizpurua, and J. J. Baumberg.  Tracking Optical Welding through Groove Modes in Plasmonic Nanocavities.  Nano Letters, 16(9):5605–5611, 2016.
  * [15] Vivek V. Thacker, Lars O. Herrmann, Daniel O. Sigle, Tao Zhang, Tim Liedl, Jeremy J. Baumberg, and Ulrich F. Keyser.  DNA origami based assembly of gold nanoparticle dimers for surface-enhanced Raman scattering.  Nat Commun, 5(3448), 2014.
  * [16] Rohit Chikkaraddy, V. A. Turek, Nuttawut Kongsuwan, Felix Benz, Cloudy Carnegie, Tim Van de Goor, Bart de Nijs, Angela Demetriadou, Ortwin Hess, Ulrich F. Keyser, and Jeremy J. Baumberg.  Mapping Nanoscale Hotspots with Single-Molecule Emitters Assembled into Plasmonic Nanocavities Using DNA Origami.  Nano Letters, 18(1):405–411, jan 2018.
  * [17] Katharina Brassat, Saminathan Ramakrishnan, Julius Burger, Marcel Hanke, Mahnaz Doostdar, Jorg K. N. Lindner, Guido Grundmeier, and Adrian Keller.  On the Adsorption of DNA Origami Nanostructures in Nanohole Arrays.  Langmuir, 34(49):14757–14765, 2018.
  * [18] Shiho Yashima, Hiroshi Sugimoto, Hiroyuki Takashina, and Minoru Fujii.  Fluorescence enhancement and spectral shaping of silicon quantum dot monolayer by plasmonic gap resonances.  Journal of Physical Chemistry C, 120:28795–28801, 2016.
  * [19] Hiroyuki Kishida and Maiken H. Mikkelsen.  Ultrafast Lifetime and Bright Emission from Graphene Quantum Dots Using Plasmonic Nanogap Cavities.  Nano Letters, 22:904–910, 2022.
  * [20] Jiani Huang, Andrew J. Traverso, Guoce Yang, and Maiken H. Mikkelsen.  Real-Time Tunable Strong Coupling: From Individual Nanocavities to Metasurfaces.  ACS Photonics, 6:838–843, 2019.
  * [21] Thang B. Hoang, Gleb M. Akselrod, Christos Argyropoulos, Jiani Huang, David R. Smith, and Maiken H. Mikkelsen.  Ultrafast spontaneous emission source using plasmonic nanoantennas.  Nature Communications, 6:7788, 2015.
  * [22] Gleb M. Akselrod, Christos Argyropoulos, Thang B. Hoang, Cristian Ciraci, Chao Fang, Jiani Huang, David R. Smith, and Maiken H. Mikkelsen.  Probing the mechanisms of large Purcell enhancement in plasmonic nanoantennas.  Nature Photonics, 8:835–840, 2014.
  * [23] Hiroshi Sugimoto, Shiho Yashima, and Minoru Fujii.  Hybridized Plasmonic Gap Mode of Gold Nanorod on Mirror Nanoantenna for Spectrally Tailored Fluorescence Enhancement.  ACS Photonics, 5:3421–3427, 2018.
  * [24] Jeremy J. Baumberg, Javier Aizpurua, Maiken H. Mikkelsen, and David R. Smith.  Extreme nanophotonics from ultrathin metallic gaps.  Nature Materials, 18(7):668–678, jul 2019.
  * [25] Ben Yang, Gong Chen, Atif Ghafoor, Yufan Zhang, Yao Zhang, Yang Zhang, Yi Luo, Jinlong Yang, Vahid Sandoghdar, Javier Aizpurua, Zhenchao Dong, and J. G. Hou.  Sub-nanometre resolution in single-molecule photoluminescence imaging.  Nature Photonics, 14(11):693–699, 2020.
  * [26] Yao Zhang, Qiu Shi Meng, Li Zhang, Yang Luo, Yun Jie Yu, Ben Yang, Yang Zhang, Ruben Esteban, Javier Aizpurua, Yi Luo, Jin Long Yang, Zhen Chao Dong, and J. G. Hou.  Sub-nanometre control of the coherent interaction between a single molecule and a plasmonic nanocavity.  Nature Communications, 8:15225, 2017.
  * [27] Rohit Chikkaraddy, Bart de Nijs, Felix Benz, Steven J. Barrow, Oren A. Scherman, Edina Rosta, Angela Demetriadou, Peter Fox, Ortwin Hess, and Jeremy J. Baumberg.  Single-molecule strong coupling at room temperature in plasmonic nanocavities.  Nature, 535(7610):127–130, jul 2016.
  * [28] Cloudy Carnegie, Jack Griffiths, Bart de Nijs, Charlie Readman, Rohit Chikkaraddy, William M. Deacon, Yao Zhang, Istvan Szabo, Edina Rosta, Javier Aizpurua, and Jeremy J. Baumberg.  Room-Temperature Optical Picocavities below 1 nm3 Accessing Single-Atom Geometries.  The Journal of Physical Chemistry Letters, 9(24):7146–7151, 2018\.
  * [29] Wenjing Liu, Bumsu Lee, Carl H. Naylor, Ho-Seok Ee, Joohee Park, A. T. Charlie Johnson, and Ritesh Agarwal.  Strong Exciton-Plasmon Coupling in MoS2 Coupled with Plasmonic Lattice.  Nano Letters, 16:1262–1269, 2016.
  * [30] Keita Tomita, Yasuhiro Kojima, and Fumihiko Kannari.  Selective Coherent Anti-Stokes Raman Scattering Microscopy Employing Dual-Wavelength Nanofocused Ultrafast Plasmon Pulses.  Nano Letters, 18:1366–1372, 2018.
  * [31] Angelos Xomalis, Xuezhi Zheng, Rohit Chikkaraddy, Zsuzsanna Koczor-Benda, Ermanno Miele, Edina Rosta, Guy A. E. Vandenbosch, Alejandro Martinez, and Jeremy J. Baumberg.  Detecting mid-infrared light by molecular frequency upconversion in dual-wavelength nanoantennas.  Science, 374:1268–1271, 2021.
  * [32] Felix Benz, Rohit Chikkaraddy, Andrew Salmon, Hamid Ohadi, Bart de Nijs, Jan Mertens, Cloudy Carnegie, Richard W. Bowman, and Jeremy J. Baumberg.  SERS of Individual Nanoparticles on a Mirror: Size Does Matter, but so Does Shape.  Journal of Physical Chemistry Letters, 7(12):2264–2269, jun 2016\.
  * [33] C. Tserkezis, R. Esteban, D. O. Sigle, J. Mertens, L. O. Herrmann, J. J. Baumberg, and J. Aizpurua.  Hybridization of plasmonic antenna and cavity modes: Extreme optics of nanoparticle-on-mirror nanogaps.  Phys. Rev. A, 92:053811, Nov 2015.
  * [34] Anna Lombardi, Angela Demetriadou, Lee Weller, Patrick Andrae, Felix Benz, Rohit Chikkaraddy, Javier Aizpurua, and Jeremy J. Baumberg.  Anomalous Spectral Shift of Near- and Far-Field Plasmonic Resonances in Nanogaps.  ACS Photonics, 3(3):471–477, 2016.
  * [35] Thang B. Hoang, Gleb M. Akselrod, and Maiken H. Mikkelsen.  Ultrafast Room-Temperature Single Photon Emission from Quantum Dots Coupled to Plasmonic Nanocavities.  Nano Letters, 16:270–275, 2016.
  * [36] Alec Rose, Thang B. Hoang, Felicia McGuire, Jack J. Mock, Cristian Ciraci, David R. Smith, and Maiken H. Mikkelsen.  Control of radiative processes using tunable plasmonic nanopatch antennas.  Nano Letters, 14, 2014.
  * [37] Nuttawut Kongsuwan, Angela Demetriadou, Matthew Horton, Rohit Chikkaraddy, Jeremy J. Baumberg, and Ortwin Hess.  Plasmonic Nanocavity Modes: From Near-Field to Far-Field Radiation.  ACS Photonics, 7(2):463–471, 2020.
  * [38] Kalun Bedingfield, Eoin Elliott, Nuttawut Kongsuwan, Jeremy J. Baumberg, and Angela Demetriadou.  Morphology dependence of nanoparticle-on-mirror geometries: A quasinormal mode analysis.  EPJ Appl. Metamat., 9:3, 2022.
  * [39] Q. Bai, M. Perrin, C. Sauvan, J-P Hugonin, and P. Lalanne.  Efficient and intuitive method for the analysis of light scattering by a resonant nanostructure.  Opt. Express, 21(22):27371–27382, 2013.
  * [40] Wei Yan, Rémi Faggiani, and Philippe Lalanne.  Rigorous modal analysis of plasmonic nanoresonators.  Physical Review B, 97(20):205422, 2018.
  * [41] Christophe Sauvan, Tong Wu, Rachid Zarouf, Egor A. Muljarov, and Philippe Lalanne.  Normalization, orthogonality, and completeness of quasinormal modes of open systems: the case of electromagnetism (Invited).  Opt. Express, 30(5):6846–6885, Feb 2022.
  * [42] Tong Wu, Massimo Gurioli, and Philippe Lalanne.  Nanoscale Light Confinement: the Q’s and V’s.  ACS Photonics, 8(6):1522–1538, 2021.
  * [43] C. Sauvan, J. P. Hugonin, I. S. Maksymov, and P. Lalanne.  Theory of the spontaneous optical emission of nanosize photonic and plasmon resonators.  Physical Review Letters, 110(23):237401, 2013.
  * [44] Philippe Lalanne.  Light-in-complex-nanostructures/MAN: Versions 7.1 of QNMEig and QNMPole, 2020.
  * [45] Philip Trøst Kristensen, Rong-Chun Ge, and Stephen Hughes.  Normalization of quasinormal modes in leaky optical cavities and plasmonic resonators.  Phys. Rev. A, 92:053810, Nov 2015.
  * [46] Rong-Chun Ge and Stephen Hughes.  Design of an efficient single photon source from a metallic nanorod dimer: a quasi-normal mode finite-difference time-domain approach.  Opt. Lett., 39(14):4235–4238, Jul 2014.
  * [47] Philip Trøst Kristensen and Stephen Hughes.  Modes and Mode Volumes of Leaky Optical Cavities and Plasmonic Nanoresonators.  ACS Photonics, 1(1):2–10, 2014.
  * [48] David A. Powell.  Resonant dynamics of arbitrarily shaped meta-atoms.  Phys. Rev. B, 90:075108, 2014.
  * [49] Xuezhi Zheng, Ventsislav K. Valev, Niels Verellen, Vladimir Volskiy, Lars O. Herrmann, Pol Van Dorpe, Jeremy J. Baumberg, Guy A. E. Vandenbosch, and V. V. Moschchalkov.  Implementation of the Natural Mode Analysis for Nanotopologies Using a Volumetric Method of Moments (V-MoM) Algorithm.  IEEE Photonics Journal, 6(4):1–13, 2014.
  * [50] Philippe Lalanne, Wei Yan, Kevin Vynck, Christophe Sauvan, and Jean Paul Hugonin.  Light Interaction with Photonic and Plasmonic Resonances.  Laser and Photonics Reviews, 12, 5 2018.
  * [51] COMSOL Multiphysics®v. 5.0. www.comsol.com. COMSOL AB, Stockholm, Sweden.
  * [52] Eoin Elliott, Kalun Bedingfield, Junyang Huang, Shu Hu, Bart de Nijs, Angela Demetriadou, and Jeremy J Baumberg.  Fingerprinting the Hidden Facets of Plasmonic Nanocavities.  ACS Photonics, 9(8):2643–2651, 2022.
  * [53] Jianji Yang, Jean-Paul Hugonin, and Philippe Lalanne.  Light-in-complex-nanostructures/RETOP: Version 8.1, 2020.
  * [54] Jianji Yang, Jean-Paul Hugonin, and Philippe Lalanne.  Near-to-Far Field Transformations for Radiative and Guided Waves.  ACS Photonics, 3(3):395–402, 2016.
  * [55] Anders Pors and Sergey I. Bozhevolnyi.  Quantum Emitters near Layered Plasmonic Nanostructures: Decay Rate Contributions.  ACS Photonics, 2(2):228–236, 2015.
  * [56] A.E. Balanis.  Antenna Theory Analysis and Design.  John Wiley & Sons, 4 edition, 2016.
  * [57] K. Demarest, Z. Huang, and R. Plumb.  An FDTD near- to far-zone transformation for scatterers buried in stratified grounds.  IEEE Transactions on Antennas and Propagation, 44(8):1150–1157, 1996.
  * [58] Rohit Chikkaraddy, Xuezhi Zheng, Felix Benz, Laura J. Brooks, Bart de Nijs, Cloudy Carnegie, Marie-Elena Kleemann, Jan Mertens, Richard W. Bowman, Guy A. E. Vandenbosch, Victor V. Moshchalkov, and Jeremy J. Baumberg.  How Ultranarrow Gap Symmetries Control Plasmonic Nanocavity Modes: From Cubes to Spheres in the Nanoparticle-on-Mirror.  ACS Photonics, 4(3):469–475, 2017.
  * [59] Syed Mubeen, Shunping Zhang, Namhoon Kim, Seungjoon Lee, Stephan Krämer, Hongxing Xu, and Martin Moskovits.  Plasmonic Properties of Gold Nanoparticles Separated from a Gold Mirror by an Ultrathin Oxide.  Nano Letters, 12(4):2088–2094, 2012.
  * [60] Rui-Qi Li, D. Hernangomez-Perez, F. J. Garcia-Vidal, and A. I. Fernandez-Dominguez.  Transformation Optics Approach to Plasmon-Exciton Strong Coupling in Nanocavities.  Physical Review Letters, 117:107401, 2016.