Sebastian Jordan Montaño
email: sebastian.jordan@inria.fr

Nahuel Palumbo
email: nahuel.palumbo@inria.fr

Guillermo Polito
email: guillermo.polito@inria.fr

Stéphane Ducasse
email: stephane.ducasse@inria.fr

Pablo Tesone
email: pablo.tesone@inria.fr

Improving Performance Through Object Lifetime Profiling: the DataFrame Case

Keywords: memory profiler, garbage collector, object lifetimes, optimization

Being capable of profiling the object lifetimes of an application gives information that can be used to optimize the GC performance and improve overall execution time. One can pre-tenure objects based on profiler information, tune the GC parameters, or take decisions about pre-allocating bigger memory segments. However, accessing object lifetimes is difficult because it requires monitoring any object GC reclamation. We developed an open-source lifetime profiler. Our current implementation does not require Virtual Machine modification. It is based on ephemerons and method proxies. We profiled DataFrame and we observed a significant number of objects that lived a long time. We used this information to tune the garbage collector parameters and we got up to 6.8 times of performance improvements.

Introduction

Modern programming languages offer automatic memory management through garbage collectors (GC) [START_REF] Jones | The garbage collection handbook: the art of automatic memory management[END_REF]. This takes the responsibility of allocating objects and freeing the allocated memory from of the developer. Pharo has a two-generation GC with a scavenging algorithm for the new generation and a stop-the-world mark-and-compact algorithm for the old generation [START_REF] Polito | Heap fuzzing: Automatic garbage collection testing with expert-guided random events[END_REF][START_REF] Miranda | Two decades of Smalltalk VM development: live VM development through simulation tools[END_REF]. The Pharo GC periodically traverses the memory to detect the objects that are not reachable (an object is not reachable when it is no longer accessible nor usable). After the memory traversal, the GC frees the unreachable objects' memory.

There are some applications in which a significant part of the execution time is spent in garbage collections. The default GC parameters are rarely ideal for any given application [START_REF] Brecht | Controlling garbage collection and heap growth to reduce the execution time of java applications[END_REF]. Consequently, there is considerable potential for optimizing such applications to mitigate garbage collection overhead. Profiling the object lifetimes gives information that can be used to optimize GC performance and improve the overall execution time. One can pre-tenure objects based on profiler information [START_REF] Blackburn | Profile-based pretenuring[END_REF], tune the GC parameters [START_REF] Lengauer | The taming of the shrew: Increasing performance by automatic parameter tuning for java garbage collectors[END_REF][START_REF] Yang | Automatic heap sizing: Taking real memory into account[END_REF][START_REF] Brecht | Controlling garbage collection and heap growth to reduce the execution time of java applications[END_REF], or take decisions of pre-allocating bigger memory segments. We define an object's lifetime as the difference between its allocation time and its finalization time 𝑜𝑏𝑗𝑒𝑐𝑡 ′ 𝑠 𝑙𝑖𝑓 𝑒𝑡𝑖𝑚𝑒 = 𝑓 𝑖𝑛𝑎𝑙𝑖𝑧𝑎𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒 -𝑎𝑙𝑙𝑜𝑐𝑎𝑡𝑖𝑜𝑛 𝑡𝑖𝑚𝑒. An object's finalization time is when the GC decides to collect it.

Understanding object lifetimes requires precise profiling information on the allocations and deallocations (when an object is reclaimed by the GC). Object allocations can be precisely identified by instrumenting all allocation sites (e.g., send the message basicNew). However, in generational GCs is not possible to precisely know when an object becomes unreachable. It will be detected when the GC traverses the memory. A long time may have passed when an object becomes unreachable and when it is reclaimed. Understanding object deallocation requires instrumenting automatic reclamation algorithms such as GCs. Furthermore, finalization mechanisms such as ephemerons [START_REF] Hayes | Ephemerons: A new finalization mechanism[END_REF] introduce a high memory overhead that reduces performance [START_REF] Valloud | Linked weak reference arrays: A hybrid approach to efficient bulk finalization[END_REF].

We developed an Object Lifetimes Profiler as a plugin of Illimani1 . Illimani is a memory profiler for Pharo [START_REF] Ducasse | Pharo 9 by Example, Book on Demand -Keepers of the lighthouse[END_REF] and it runs on an unmodified Pharo virtual machine. It is available under an open-source MIT license. Our profiler tracks the object lifetimes of a given application via instrumentation by controlling the execution whenever an object is allocated. MethodProxies2 is a library that decorates and controls the method execution by executing user-defined behavior before or after a method's execution. We used this library to do the instrumentation.

We evaluated our solution by observing how object lifetimes relate to performance improvements when tuning the GC. We choose as a case study the loading of a 500 MB dataset into a DataFrame [START_REF] Zaytsev | Towards exploratory data analysis for pharo[END_REF]. We have selected DataFrame3 library for our study because it is often used in memory-intensive applications such as machine learning, data mining, and data analysis [START_REF] Zaitsev | How fast is ai in pharo? benchmarking linear regression[END_REF]. The profiler gave us object lifetimes.

We observed that our case study has 25% of long-lived objects that represent 40% of the allocated memory (Figures 4,5). Applications that have many objects that live a fairly long time suffer from performance issues [START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF]. Increasing the GC heap size has a significant impact on GC performance [START_REF] Yang | Automatic heap sizing: Taking real memory into account[END_REF][START_REF] Brecht | Controlling garbage collection and heap growth to reduce the execution time of java applications[END_REF]. With this information, we decided to tune the GC parameters to see if we can get performance improvements [START_REF] Ungar | Tenuring policies for generation-based storage reclamation[END_REF][START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF][START_REF] Lengauer | The taming of the shrew: Increasing performance by automatic parameter tuning for java garbage collectors[END_REF]. We chose 5 non-default GC parameter configurations that increase the heap size and we then benchmarked the loading of the DataFrame with these configurations. We obtained improvements of up to 6.8 times compared to the default GC parameters when the number of full garbage collections is reduced.

Paper's contributions. This paper makes the following contributions:

• It presents the challenges of lifetime profiling opening the door for future profiler improvements. • It introduces a lifetime profiler capable of tracking the object lifetimes for a given application with the unmodified Pharo VM.

Paper's outline. Section 2 explains the automatic memory management in Pharo and the challenges of computing the object lifetimes; Section 3 explains our solution; Section 4 explains the validation of our solution profiling a memory-intensive application; Section 5 presents the discussion; Section 6 presents related work; and Section 7 finishes with the conclusion and the future work.

Automatic memory management in Pharo

Pharo has a two-generation garbage collector with a young and an old generation. The newly allocated objects are allocated in the new generation, also called new space. The old space is where the objects, after surviving a certain number of GC cycles are promoted. This promoting process is called tenuring.

Generational GCs are designed to leverage an empirical property of objects: young objects are more prone to die while older ones tend to persist in memory [START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF]. These GCs are configured to exploit this empirical property.

The new space uses a scavenging algorithm while the old space uses a stop-the-world markand-compact algorithm [START_REF] Polito | Heap fuzzing: Automatic garbage collection testing with expert-guided random events[END_REF][START_REF] Miranda | Two decades of Smalltalk VM development: live VM development through simulation tools[END_REF]. An incremental garbage collection executes the scavenging algorithm while a full garbage collection executes both a scavenging and the stop-the-world mark-and-compact algorithm. Running a full garbage collection is slower than an incremental one by orders of magnitude [START_REF] Ungar | Tenuring policies for generation-based storage reclamation[END_REF]. For this reason, the scavengers are executed orders of magnitude more often.

Each time that a full garbage collection is executed, the GC traverses the objects that are in the old space to detect the ones that are not reachable to then reclaim them. An object is not reachable when it stops being accessible and usable by the application. Afterwards, the GC frees the memory of all the non-reachable objects. Ephemerons [START_REF] Hayes | Ephemerons: A new finalization mechanism[END_REF] are a new finalization mechanism that is implemented in the Pharo Virtual Machine version 104 . They allow one to perform a user-defined action when an object is about to be reclaimed by the GC.

In Pharo, almost all computations are done by sending a message [START_REF] Bergel | Counting messages as a proxy for average execution time in pharo[END_REF]. This is the case for allocating an object too. In Pharo 11, 4 methods are responsible for allocating objects: Behavior»basicNew , Behavior»basicNew: , Number»@ , and Array class»new: . These methods are special methods that are executed natively.

Understanding object lifetimes requires precise profiling information about the allocations and the garbage collections. Object allocations can be precisely identified by instrumenting the allocation sites (e.g., the allocator methods). However, as Pharo has a two-generation GC is not possible to precisely know when an object becomes unreachable (stops being accessible). A long time may pass until the object became unreachable and when the GC decided to finalize it. Detecting when an object is being reclaimed by the automatic memory manager requires instrumenting the GC. The available finalization mechanisms in Pharo, such as ephemerons [START_REF] Hayes | Ephemerons: A new finalization mechanism[END_REF], introduce a high memory overhead that reduces performance [START_REF] Valloud | Linked weak reference arrays: A hybrid approach to efficient bulk finalization[END_REF].

Profiling object lifetimes

We instrumented the 4 allocator methods (Behavior»basicNew , Behavior»basicNew: , Number»@ , and Array class»new: ) to intercept whenever they are invoked using MethodProxies. MethodProxies allow one to decorate and control the execution of a method. With the instrumentation, we are able to capture the exact allocation time. Within the instrumentation, we also installed an ephemeron for each of the allocated objects that will set its finalization time when the object will be reclaimed by the GC. We also store the object's size in memory. For example Array class is requesting an object allocation invoking the method Behavior»basicNew . After the allocation is produced, the instrumentation captures the execution before the object is returned to the sender. Inside the instrumentation, an object's model is created that will hold the object's allocation and finalization time and its size in memory. The object's allocation time is set and an ephemeron is instantiated.

When the object is being garbage collected the ephemeron will set its finalization time in the object's model. Figure 2 shows an object's finalization. First, the GC detects that an ephemeron can be finalized because it is unreachable. The GC will put the ephemeron into a finalization queue. Then, the GC will consume the ephemerons from the finalization queue one by one. The message mourn will be sent to the ephemeron as part of the finalization process. The ephemeron will send the message finalize to its finalizer, which is the object's model. This finalizer will set the object's finalization time. Finally, the GC frees the memory of the object. An object's finalization time is not exact, it rather depends on when the GC detects that the object is unreachable. As discussed in Section 2, an object is detected as unreachable when the GC traverses the memory in both, the new and the old space.

Improving DataFrame performance through lifetime profiling

This section describes the effectiveness of our solution. We answer the following research question:

• Does our lifetime profiler provide information that can lead to improvements in GC performance? We respond to this question positively. We evaluated our profiler by profiling the execution of loading a 500 MB CSV file into a DataFrame. We choose DataFrame as our target application because it is a memory-intensive application that supports loading big files to do data engineering and machine learning [START_REF] Zaitsev | How fast is ai in pharo? benchmarking linear regression[END_REF].

Methodology

We applied the following methodology for validating our profiler: We profile the execution of a given application and we then benchmark it to know how much time was spent on garbage collections. Then, we choose non-default GC parameters taking into consideration the object lifetimes and the GC spent time. If the profiler reports a significant quantity of long-lived objects, we choose non-default GC parameters that increase the memory heap and reduce the number of full garbage collections. With these custom GC parameters, we benchmark again our target application. We finally validate our profiler comparing the performance with the tuned GC parameters against the default ones. Figure 3

Lifetime profiling results

The profiler gives a density chart of the object lifetimes. We grouped the object lifetimes by intervals of one second. All objects whose lifetime duration has the same second will be in the same bucket. In Figure 4, we calculated the density as a function of the actual memory size occupied by the objects. We can observe that around 40% of memory stayed referenced for a long time.

In Figure 5 we calculated the density but in function by the number of objects instead of the occupied memory. Crossing this information with Figure 4 we get that 25% of the objects that represent 40% of the GC memory stay referenced for a long time.

Benchmarking DataFrame

We benchmarked the loading of a DataFrame but this time without the instrumentation. We used the default GC parameters when running these benchmarks. To improve the reproducibility of benchmarking, we used the best developer techniques for the benchmarks [START_REF] Georges | Statistically rigorous java performance evaluation[END_REF]: we cut the internet connexion and stopped all non-vital applications. We run each of the benchmarks n-times and then we reported the average execution time with the standard deviation. We used benchy 5 as the infrastructure for running the benchmarks. Benchy is an open-source application that serves as configurable infrastructure to run customizable benchmarks in Pharo. We benchmarked the loading of 3 CSV files of different sizes: 500 MB, 1.6 GB, and 3.1 GB.

We present the results of the benchmarks for the 3 different CSV files in Table 1. The benchmarks that are presented in Table 1 show that there is a significant part of the execution time spent doing garbage collections, going from 15% to 89%, with the default GC parameters.

Tuning garbage collector parameters

Generational GCs suffer from poor performance when dealing with memory-intensive applications that generate numerous intermediate objects, which live a fairly long time under the default GC parameters [START_REF] Kaleba | Garbage collection evaluation infrastructure for the cog vm[END_REF][START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF]. Our profiler showed that DataFrame is an application that produces long-lived objects. DataFrame has 25% of the objects that represent 40% of the allocated memory that live for a fairly long time (Figures 4,5). Increasing the GC heap size has a significant impact on GC performance [START_REF] Yang | Automatic heap sizing: Taking real memory into account[END_REF][START_REF] Brecht | Controlling garbage collection and heap growth to reduce the execution time of java applications[END_REF]. One can reduce GC time by tuning the GC parameters [START_REF] Lengauer | The taming of the shrew: Increasing performance by automatic parameter tuning for java garbage collectors[END_REF]. The benchmarks exhibited optimization opportunities by reducing the garbage collection time.

Generational GCs are not optimized for applications with a substantial number of long-lived objects. Instead, they are specifically configured for applications where objects tend to die young [START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF]. We discussed with Pharo experts about Pharo's GC implementation details. With this internal knowledge of Pharo's GC implementation and the DataFrame internals, we chose the 5 custom GC parameters. We chose by hand these 5 custom GC parameters that we knew will increase the heap size and reduce the number of garbage collections.

The Pharo GC has 4 available customizable parameters. In Pharo, the heap size can be seen as the sum of the new and the old space. One can control the heap size by tuning these customizable GC parameters.

• Eden size represents 5/7 of the new space and it is where the objects are allocated; the other 2/7 of space is used for copying objects. • Growth headroom is the minimum amount of space the GC will request to the operating system to allocate • Shrink threshold is the amount of free space that the GC will manage before giving it back to the OS. • GC ratio is a percentage that triggers a full garbage collection when the heap will grow that percentage.

Then as explained in Figure 3, we benchmarked the loading of the DataFrame with the 3 different CSV files with these 5 GC parameter configurations to see if we reduce the garbage collection time. We obtained improvements of up to 6.8 times compared to the default GC parameters.

Table 2 describes the 5 non-default GC parameters that we chose. In the following tables, we present the results that we obtained re-running the 3 benchmarks with the 5 configurations. For the 500 MB CSV, we got from the benchmark in Table 1 that 15% of the time is spent on garbage collecting. In Table 3 we observe that we increased the performance up to 1.2 times.

In Table 4 we observe that we increased the performance up to 1.2 times for loading the 1.6 GB CSV file into the DataFrame. For this CSV file, we got 22% execution passed doing garbage collections. The performance improvements are the same as the precedent benchmark.

In Table 5 we observe that we increased the performance up to 6.8 times with configuration 5. This enhancement can be attributed to the fact that, for this 3.1 GB, 89% of the execution time is spent doing garbage collections. Configuration 5 has a larger memory footprint compared to the default parameters. Comparing Configuration 5 with the default GC configuration, when the GC requires more memory it allocates segments of 512 MB instead of 32 MB and the new space starts with 512 MB instead of 15 MB.

Discussion

We describe some challenges of object lifetimes profile that we faced during the writing of this paper: GC custom parameters. We chose the GC parameters arbitrarily based on expert knowledge of Pharo's GC implementation and the object lifetimes of our target application. The parameters were chosen with the objective of increasing the heap size and reducing the number of garbage collections.

Cost of the instrumentation. Our implementation relies on instrumentation. We measured the impact of it and we got an overhead of at least 50 times According to our measurements, the ephemerons have the biggest impact on the overhead. For this reason, we were not able to profile loading a bigger CSV file. Nevertheless, the lifetime profile that we got was useful for taking GC optimization decisions for the 3 different CSV files that we benchmarked.

GC Stress. For tracking the object lifetimes we allocate an object's model that stores the allocation and finalization time of the object as long as the size in memory. We also allocate an ephemeron to finalize the object when it will be collected. This introduces stress to the GC as we are multiplying the allocations by three.

Ephemeron's Queue. When the GC detects that an ephemeron is a candidate for collection, it puts it into a finalization queue. Once in the queue, it creates a strong reference to its key object, the one that is being garbage collected. If one of the objects in the queue is the root of a sub-graph of unreachable objects, this strong reference will avoid the whole object sub-graph from being collected and it will only collect the root. This can delay the collection of some objects, increasing their lifetime.

Nepotism. Nepotism [START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF] happens when tenured garbage makes its referenced objects, which are also garbage, to be tenured too. This happens when an object that is about to die gets tenured. As the object is now in the old space, until a full GC is triggered, the GC will not detect that the object became unreachable, it will treat it as reachable until the next run of the full garbage collection. If this tenured garbage references other objects, those objects become candidates for being tenured and can eventually get tenured too. This affects negatively the GC performance since it passes time copying and updating references of garbage. This problem is not specific to our profiler nor to the instrumentation but to the generational GCs themselves.

Related work

Automatic GC parameter tuning. Lengauer et al. [START_REF] Lengauer | The taming of the shrew: Increasing performance by automatic parameter tuning for java garbage collectors[END_REF] proposed a technique to automatically tune the GC parameters for the Java programming language. They used an optimization algorithm that adjust the parameters with the objective function being the aggregated garbage collection time. The authors ran their experiments on the Java 8 Hotspot TM VM. The difference with our work is that they optimized the GC performance automatically in a black-box manner while we used the object lifetimes information given by our profiler to take decisions about the appropriate GC parameters.

Adaptative tenuring policies. Ungar et al. [START_REF] Ungar | An adaptive tenuring policy for generation scavengers[END_REF] instrumented a Smalltalk VM to track the object lifetimes. They use this information to change the tenuring policies to reduce the amount of tenuring garbage. Their objective was to optimize the GC performance. Their work differs from ours in the sense that they used to object lifetimes information to change the tenuring policies while we used it to tune the GC parameters.

GC infrastructure evaluation. Kaleba et al. [START_REF] Kaleba | Garbage collection evaluation infrastructure for the cog vm[END_REF] benchmarked the GC of the Cog VM for one memory-intensive application. The difference with our work is that we used the object lifetimes profile to choose the custom GC parameters for our application. We then benchmarked our application with these different GC configurations and compared their performance. Kaleba et at. ran their benchmarks with different GC algorithms and modified only one GC parameter: the Eden size. They chose the Eden size value with their application's knowledge without any profile information.

Profiled-based pretenuring Blackburn [START_REF] Blackburn | Profile-based pretenuring[END_REF] et al. used profile information to make decisions for pre-tenuring objects. In their approach, they took objects allocation information such as the object lifetimes to pre-tenure objects for increasing performance. Our approach is different in the sense that we use the object lifetimes to tune the GC parameters.

Hybrid finalization mechanism. Valloud [9] implemented a new finalization mechanism for the HPS Smalltalk VM. Valloud explains that there were performance issues with the two available finalization mechanisms: Weak Arrays and Ephemerons. Weak arrays are described as inefficient and ephemerons introduce a large memory overhead. The author developed a new finalization mechanism that combines both approaches for improving performance. We observed the same large memory overhead caused by the ephemerons in our use case.

Conclusion and future work

We developed a lifetime profiler that tracks the lifetime of objects that were allocated during the execution of an application. It tracks the object lifetimes of a given application via instrumentation by controlling the execution whenever an object is allocated. We profiled the object lifetimes of a DataFrame when loading a big CSV file. We evaluated our solution by observing how object lifetimes relate to performance improvements when tuning the GC. We obtained a profile that exhibited that there were 25% of objects that represent 40% of the memory that lived for a fairly long time.

We discussed with Pharo experts about the implementation details of Pharo's GC. With the knowledge of how Pharo's GC is implemented and the fact that DataFrame produces a fairly large number of long-lived objects, we chose 5 GC parameter configurations that increase the heap size. We then benchmarked the loading of 3 big CSV files into a DataFrame with these 5 custom parameters and we observed a performance increase up to 6.8 times compared with the default GC parameters.

As future work, we plan to profile the object lifetimes at the virtual machine level to reduce the overhead that the instrumentation introduces. To mitigate the GC stress we want to explore the idea of sampling the object allocations and compare the sampling precision with taking all the allocations. We also aim to explore automated techniques for detecting an optimal set of GC parameters to enhance an application's performance. Finally, we also want to explore taking pre-tenuring decisions using the object lifetimes profile information.

Figure 1 : 4 Figure 2 :Figure 1

 1421 Figure 1: The allocation of an object at a time n

5 .

 5 Did the performance improved? GC tuned parameters 2. Benchmark it with the default GC parameters 4. Benchmark the application again with the tuned GC parameters 1. Profile the application Default GC parameters benchmark Tuned GC parameters benchmark

Figure 3 :

 3 Figure 3: Validation methodology

Figure 4 :

 4 Figure 4: Object lifetimes profile by memory for a 500MB dataset

Table 1

 1 Object lifetimes profile for a 500MB dataset by number of objects Benchmark when loading a DataFrame with the default GC parameters

	5 https://github.com/tesonep/benchy

75%

Figure 5:

Table 2

 2 GC tuning parameter configurations

	Configuration Eden size Growth headroom Shrink threshold GC ratio
	Default	15MB	16MB	32MB	33%
	Configuration 1	64MB	64MB	128MB	250%
	Configuration 2	150MB	128MB	128MB	250%
	Configuration 3	300MB	128MB	128MB	500%
	Configuration 4	300MB	256MB	256MB	1000%
	Configuration 5	300MB	512MB	512MB	1000%

Table 3

 3 Changing the parameters for the 500 MB DataFrame

GC Configuration GC spent time Total execution time Improved performance

	Default	11.18 sec	70.78 sec	1×
	Configuration 1	4.08 sec	63.72 sec	1.1×
	Configuration 2	2.91 sec	64.10 sec	1.1×
	Configuration 3	2.07 sec	61.01 sec	1.1×
	Configuration 4	2.21 sec	60.78 sec	1.2×
	Configuration 5	2.17 sec	60.58 sec	1.2×
	Table 4
	Changing the parameters for the 1.6 GB DataFrame
	GC Configuration GC spent time Total execution time Improved performance
	Default	60.31 sec	4 min 8 sec	1×
	Configuration 1	42.48 sec	3 min 54 sec	1.1×
	Configuration 2	17.97 sec	3 min 30 sec	1.2×
	Configuration 3	14.99 sec	3 min 23 sec	1.2×
	Configuration 4	11.69 sec	3 min 19 sec	1.2×
	Configuration 5	12.93 sec	3 min 20 sec	1.2×

Table 5

 5 Changing the parameters for the 3.1 GB DataFrame

GC Configuration GC spent time Total execution time Improved performance

	Default	58 min 18 sec	1 h 6 min 18 sec	1×
	Configuration 1	9 min 41 sec	17 min 46 sec	3.7×
	Configuration 2	4 min 57 sec	12 min 54 sec	5.1×
	Configuration 3	5 min 8 sec	13 min 2 sec	5.1×
	Configuration 4	2 min 42 sec	10 min 37 sec	6.2×
	Configuration 5	1 min 47 sec	9 min 42 sec	6.8×

https://github.com/jordanmontt/illimani-memory-profiler

https://github.com/pharo-contributions/MethodProxies

https://github.com/PolyMathOrg/DataFrame

https://github.com/pharo-project/pharo-vm

Acknowledgments

We express our gratitude to the anonymous reviewers for providing valuable comments on the draft of this paper.


Maximilian Mayländer

Philipp Thielert

Theresia Quintes

Andreas Vargas Jentzsch
email: vargasjentzsch@unistra.fr

Sabine Richert
email: sabine.richert@physchem.uni-freiburg.de

Room temperature electron spin coherence in photogenerated molecular spin qubit candidates

One of the main challenges in the emerging field of molecular spintronics is the identification of new spin qubit materials for quantum information applications. In this regard, recent work has shown that photoexcited chromophore-radical systems are promising candidates to expand our repertoire of suitable candidate molecules.

Here, we investigate a series of three chromophore-radical compounds composed of a perylene diimide (PDI) chromophore and a stable 2,2,6,6-tetramethyl-piperidin-1-oxyl (TEMPO) radical by transient electron paramagnetic resonance (EPR) techniques. We explore the influence of isotope labelling of the TEMPO moiety on the EPR spectra and electron spin coherence times of the molecular quartet states generated upon photoexcitation and illustrate that (i) a coherent manipulation of the spin state is possible in these systems even at room temperature and that (ii) a spin coherence time of 0.7 µs can be achieved under these conditions. This demonstration of electron spin coherence at ambient temperatures paves the way for practical applications of such systems in functional molecular devices.

Introduction

A lot of recent work in the emerging field of molecular spintronics has focussed on the identification of novel materials that can generate, transfer, and store spin information efficiently. [START_REF] Troiani | Molecular spins for quantum information technologies[END_REF][START_REF] Cornia | The molecular way[END_REF][START_REF] Moreno-Pineda | Molecular spin qudits for quantum algorithms[END_REF][START_REF] Atzori | The second quantum revolution: role and challenges of molecular chemistry[END_REF][START_REF] Wasielewski | Exploiting chemistry and molecular systems for quantum information science[END_REF] Among these materials, photoexcited chromophore-radical systems have emerged as a new class of compounds with promising properties. [START_REF] Teki | Excited-state dynamics of non-luminescent and luminescent π-radicals[END_REF][START_REF] Quintes | Properties and applications of photoexcited chromophore-radical systems[END_REF] In perylene diimide (PDI)-radical derivatives, it could, for instance, be shown that the molecular quartet state formed after photoexcitation has properties required for quantum logic and memory applications and is thus viable as a spin qudit: [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF][START_REF] Qiu | Optical spin polarization of a narrow linewidth electron spin qubit in a chromophore/stable-radical system[END_REF] in analogy to NV -centres, it can be initialised by light in a highly pure initial state. In addition, it is long-lived, and exhibits coherence times that are much longer than typical pulse microwave-driven gate operation times, even at moderate temperatures of 80 K. This demonstration of coherent spin properties in frozen solution at 80 K was remarkable since most previous studies on molecular qubit candidates were limited to liquid helium temperatures, often as low as 2-10 K. [START_REF] Wedge | Chemical engineering of molecular qubits[END_REF][START_REF] Sproules | Molecules as electron spin qubits[END_REF][START_REF] Gaita-Ariño | Molecular spins for quantum computation[END_REF] However, for the integration of such coherent molecular spin systems in practical spintronic devices, it would be desirable to be able to measure them at even higher temperatures, ideally under ambient conditions.

The magnetic properties of some chromophore-radical systems investigated thus far have already been studied by transient continuous wave electron paramagnetic resonance (trEPR) spectroscopy in liquid solution, [START_REF] Qiu | Optical spin polarization of a narrow linewidth electron spin qubit in a chromophore/stable-radical system[END_REF][START_REF] Giacobbe | Ultrafast intersystem crossing and spin dynamics of photoexcited perylene-3,4:9,10bis(dicarboximide) covalently linked to a nitroxide radical at fixed distances[END_REF][START_REF] Colvin | Ultrafast intersystem crossing and spin dynamics of zinc meso-tetraphenylporphyrin covalently bound to stable radicals[END_REF] but a coherent manipulation of the resulting spin states, by pulse EPR spectroscopy at room temperature, has not been demonstrated, yet.

In the present study, we investigate a series of three different PDI based chromophore-radical systems by trEPR and transient pulse EPR techniques. The three molecules differ with respect to the isotope labelling of the TEMPO (2,2,6,6-tetramethyl-piperidin-1-oxyl) radical moiety. The optical properties of the unlabelled PDI-TEMPO system were already studied earlier, [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF][START_REF] Mayländer | Accessing the triplet state of perylenediimide by radical-enhanced intersystem crossing[END_REF] allowing us here to focus on the effect of isotope labelling and different measurement conditions on the coherent spin properties of PDI-TEMPO.

We demonstrate, that, by embedding the molecules in a rigid polymer matrix, spin relaxation can be slowed down sufficiently to enable a pulse EPR investigation of the photogenerated spin system at room temperature.

Compared to the values obtained in isotropic frozen solution at 80 K, the spin coherence times in polymer films at room temperature are shortened by about a factor of four, making these molecules still well competitive with other molecular organic and inorganic systems studied so far at elevated temperatures. [START_REF] Atzori | Room-temperature quantum coherence and Rabi oscillations in vanadyl phthalocyanine: toward multifunctional molecular spin qubits[END_REF][START_REF] Bader | Room temperature quantum coherence in a potential molecular qubit[END_REF] Further, by performing Rabi oscillation experiments, we demonstrate that a coherent manipulation of the spin system is feasible even under ambient conditions, paving the way for the integration of similar molecular systems into organic spintronic devices.

Results and Discussion

Optical characterisation. Figure 1 gives an overview of the structures of the three investigated PDI-TEMPO derivatives as well as the processes occurring after photoexcitation of the PDI chromophore, which lead to the formation of novel spin states. All synthetic details can be found in the Supporting Information (SI, Section 1).

After photoexcitation of PDI at 535 nm, the chromophore triplet state is rapidly generated in these systems with a time constant of ∼110 ps and a yield of ∼50 %. [START_REF] Mayländer | Accessing the triplet state of perylenediimide by radical-enhanced intersystem crossing[END_REF] As would be expected, isotope labelling of the TEMPO moiety has no discernible influence on neither the excited state energies nor the rates and yields of the excited singlet state deactivation, as reflected by identical optical spectra and an identical fluorescence quantum yield of 0.04±0.01 for all three dyads. The UV-vis absorption spectra and experimental procedures can be found in the SI (Section 2.1, Figure S2). The splitting of the energy levels of the quartet and excited doublet states is shown here for the strong coupling regime and ferromagnetic coupling. In the intermediate coupling regime, doublet and quartet states are mixed, leading to additional transitions. [START_REF] Quintes | Properties and applications of photoexcited chromophore-radical systems[END_REF] Abbreviations: R-radical, T-triplet, EISC-enhanced intersystem crossing, Q-quartet state.

J TR Q 1 2 - 3 2 - 3 2 + 1 2 + 1 2 - 1 2 + ⎧ ⎨ ⎧ ⎧ ⎧ ⎨ ⎨ 1 2 - 1 2 + 1 2 - 1 2 + 3 2 1 PDI -2 R • 1* PDI -2 R • 3* PDI -2 R • 4* [ 3 PDI -2 R • ] 2* [ 3 PDI -2 R • ]
EPR characterisation in frozen solution. In our previous study, [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF] we reported on the magnetic properties of unlabelled PDI-TEMPO in isotropic frozen solution at 80 K. Transient nutation measurements revealed that all features in the transient spectrum can be attributed to a species with quartet multiplicity. Further, we showed that the complex central feature, observed in the trEPR spectrum of PDI-TEMPO, can be reproduced in spectral simulations if the effect of hyperfine coupling to the nitrogen nucleus of the TEMPO moiety is taken into account in addition to the zero-field splitting of the quartet state. The four quartet sublevels are thus further split by the nitrogen (I = 1) hyperfine interaction, resulting in a total of twelve accessible spin states. In addition, pulse EPR measurements showed that this photogenerated molecular multi-level system may be viable as a spin qudit candidate as it can be initialised by light in a pure quartet spin state, is long-lived and exhibits coherence times that are longer than typical pulse microwave-driven gate operation times.

Spin qudits (i.e., qubits with more than two levels) can only be realised with organic [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF][START_REF] Qiu | Optical spin polarization of a narrow linewidth electron spin qubit in a chromophore/stable-radical system[END_REF] or inorganic [START_REF] Wedge | Chemical engineering of molecular qubits[END_REF][START_REF] Sproules | Molecules as electron spin qubits[END_REF][START_REF] Gaita-Ariño | Molecular spins for quantum computation[END_REF][START_REF] Zadrozny | Multiple quantum coherences from hyperfine transitions in a vanadium(IV) complex[END_REF][START_REF] Ferrando-Soria | A molecular design of molecular qubits to implement universal quantum gates[END_REF][START_REF] Asaad | Coherent electrical control of a single high-spin nucleus in silicon[END_REF] molecular high-spin (S, I > 1/2) systems or dopants (as opposed to mesoscopic solid state systems such as semiconductors and vacancy centres) and their use in quantum information science has the striking advantages that the number of iterations in quantum algorithms as well as the error rate can, in principle, be decreased and more complex gate operations can be performed in a single physical unit without the need for inter-qubit communication. [START_REF] Moreno-Pineda | Molecular spin qudits for quantum algorithms[END_REF][START_REF] Moreno-Pineda | Molecules as qubits, qudits and quantum gates[END_REF] Given the potential of PDI-TEMPO as a photogenerated molecular spin qudit, the aim of the EPR investigations presented here was to explore different possibilities of enhancing the spin coherence times in this molecule and to make the system amenable to a coherent manipulation of the spin state populations under ambient conditions.

The two different strategies pursued here to limit spin decoherence are (i) isotope labelling of the radical moiety and (ii) the embedding of the molecules in a rigid polymer matrix.

To explore the effect of isotope labelling of the radical moiety, we started by characterising the three different PDI-TEMPO compounds and identifying any differences between them with respect to their magnetic properties, using trEPR. The measurements were carried out at Q-band frequencies in isotropic frozen toluene solution at 80 K and the corresponding data are shown in Figure 2 together with the best numerical fits to the data. S1-S3).

Comparing the experimental transient EPR spectra of the three dyads (see also Figures S7 and S8 in the SI),

we observe that the overall spectral shape is qualitatively similar in all cases. All spectra are characterised by an aeeaae multiplet polarisation (a: enhanced absorption, e: emission) and a dominant central feature, the so-called "net polarisation" associated with the quartet |m S = + 1 2 ⟩ ↔ |m S = -1 2 ⟩ transition, with aea polarisation. While the central feature was previously proposed to arise from an unequal population of hyperfine states, [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF] the observed multiplet polarisation pattern indicates a selective population of the high-field quartet sublevels with | ± [START_REF] Troiani | Molecular spins for quantum information technologies[END_REF] 2 ⟩, which was suggested to be caused by a mechanism involving electron transfer from TEMPO to PDI followed by fast charge recombination to the chromophore triplet state. [START_REF] Mayländer | Accessing the triplet state of perylenediimide by radical-enhanced intersystem crossing[END_REF] Regarding the multiplet polarisation of the coupled spin system, we would not expect any qualitative difference between the three dyads since no difference in the triplet state formation mechanism is expected. However, given that the central feature was assumed to arise from a splitting of the quartet sublevels by the nitrogen hyperfine interaction of TEMPO, the observation of a central three-line pattern for all compounds including PDI-TEMPOd 17 - [START_REF] Mayländer | Accessing the triplet state of perylenediimide by radical-enhanced intersystem crossing[END_REF] N was unexpected at first, but could be clarified with the help of numerical simulations of the spectra using EasySpin [START_REF] Stoll | a comprehensive software package for spectral simulation and analysis in EPR[END_REF] (v6.0.0-dev.50) as will be explained in the following. A detailed overview of the simulation strategy is presented in the SI (Section 2.5) and a visual explanation of the observation of a central three-line pattern for both the PDI-TEMPO and PDI-TEMPO-d 17 -15 N compounds is provided in Figure S14.

For the simulation of the trEPR spectra, a coupled triplet-radical spin system (S 1 = 1, S 2 = 1

2 ) was assumed. The number of variable simulation parameters could be significantly reduced by a separate determination of the coupling parameters of the triplet and radical precursors, which were then kept fixed during the fitting procedure.

To obtain the g-and A-tensors of the radical, a global fit of a X-band continuous wave (cw) EPR spectrum and a Q-band pulse EPR spectrum in frozen solution was performed (Figures S3 andS4), while g T , D T , and E T of the triplet state were obtained from a simulation of the trEPR spectrum of PDI (see Figure S6). The only variable parameters were thus the coupling parameters (J TR , D TR ) as well as the populations of the spin states. The latter are visualised next to the trEPR spectra in Figure 2.

The peak separation and linewidth of the central spectral feature is different for PDI-TEMPO-d 17 -15 N, which correlates well with the expected difference in hyperfine coupling. The simulations reveal further that the shape of the complex central feature is not only affected by the populations of the hyperfine levels, but also by the coupling regime (i.e., the exchange and dipolar coupling parameters). We find that, in particular, the outer spectral features and spectral intensities can only be reproduced well, if the system is assumed to be in the upper intermediate coupling regime with |J TR | ∼ 1200 MHz. This coupling regime is still consistent with the observation of quartet signatures in transient nutation experiments [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF] and might, at the same time, explain the unequal population of the hyperfine states, as the quartet and excited doublet states are close in energy and mixing between them is efficient.

Such an unequal population would be rather unexpected for a system in the strong coupling regime since the energy difference between the hyperfine levels is very small compared to that between the quartet and excited doublet states.

In summary, the magnetic parameters and sublevel populations were found to be very similar for unlabelled PDI-TEMPO and PDI-TEMPO-d 17 , which is consistent with the fact that the spectral shape is mainly dominated by the zero-field splitting and nitrogen hyperfine interactions. A careful analysis of the trEPR spectra of all three dyads by spectral simulations revealed that the observation of a central three-line pattern for all isotopologues can be ascribed to the system being in the intermediate coupling regime, where additional transitions are expected (see also Figure S14). [START_REF] Quintes | Properties and applications of photoexcited chromophore-radical systems[END_REF] However, the difference in peak intensities and peak separations between PDI-TEMPO and PDI-TEMPO-d 17 -15 N can only be explained if the contribution of nitrogen hyperfine coupling of TEMPO to the spectral shape is taken into account.

Coherence decay in frozen solution. To explore the influence of isotope labelling on the spin coherence times of both the nitroxide radical as well as the quartet spin state generated upon photoexcitation, pulse EPR measurements were carried out at the Q-band in frozen toluene solution at 80 K. The spin coherence times (T m ) measured at a field position corresponding to the intensity maximum of the nitroxide signal (see Figure S5 for the pulse EPR spectra) are compared for the three PDI-TEMPO dyads in Figure 3a. To obtain the T m values listed in the figure, the data were fitted with a single stretched exponential of the form [START_REF] Johnston | Stretched exponention relaxation arising from a continuous sum of exponential decays[END_REF][START_REF] Wang | Quantum many-body theory for electron spin decoherence in nanoscale nuclear spin baths[END_REF][START_REF] Soetbeer | Dynamical decoupling in water-glycerol glasses: a comparison of nitroxides, trityl radicals and gadolinium complexes[END_REF] V SE = exp -(2τ /T m ) β The fact that the effect of isotope labelling on the coherence times of the nitroxide is small, is in line with literature observations suggesting that the rotation of the methyl groups is the dominant factor causing spin decoherence in TEMPO radicals. For instance, a replacement of the two methyl groups on each side of the NO-group by spirocyclohexyl has been shown to lead to much improved coherence times over a wide temperature range. [START_REF] Kathirvelu | Relaxation rates for spirocyclohexyl nitroxyl radicals are suitable for interspin distance measurements at temperatures up to about 125[END_REF][START_REF] Kuzhelev | Room-temperature electron spin relaxation of nitroxides immobilized in threhalose: effect of substituents adjacent to NO-group[END_REF] Figure 3b shows the coherence times measured for the quartet state |m S = + 1 2 ⟩ ↔ |m S = -1 2 ⟩ transition at a field position corresponding to the central line with emissive spin polarisation. The values obtained for T m are again listed in the figure. Interestingly, the effect on T m observed for the labelled nitroxide radicals is perfectly reflected in the corresponding quartet state coherence times. It seems that the coherence time of the radical has a direct impact on the coherence time of the quartet state generated by photoinduced spin mixing: Between PDI-TEMPO and PDI-TEMPO-d 17 -15 N an increase in T m from 2.0 to 2.6 µs (factor 1.3) is observed, which compares well with the increase of T m by a factor of 1.2 observed for the corresponding radicals. This observation could turn out to be crucial for any future investigations and applications of photogenerated high-spin systems, as it suggests that the coherence properties of the photogenerated state can be optimised and further enhanced by improvement of the radical coherence times, for which synthetic strategies already exist. [START_REF] Haugland | 2'-Alkynylnucleotides: a sequence-and spin label-flexible strategy for EPR spectroscopy in DNA[END_REF] Room temperature spin coherence. To demonstrate electron spin coherence under ambient conditions, we developed experimental protocols to embed the molecules in rigid polymer films suitable for pulse EPR measurements at Q-band frequencies. Details regarding the sample preparation using poly(methyl methacrylate), PMMA, can be found in the SI (Section 2.2). Since PDI-TEMPO-d 17 -15 N showed the most promising magnetic properties in frozen solution, room temperature pulse EPR experiments are only shown here for this compound, while the corresponding data obtained for unlabelled PDI-TEMPO are presented in the SI (see Figures S10 andS11).

While no transient pulse EPR measurements are feasible with these molecules in isotropic solution at room temperature, the partial immobilisation of the molecular motions by insertion of the compounds in a polymer host matrix makes them amenable to a coherent spin manipulation by microwave pulses, as illustrated in Figure 4.

Figure 4a shows the echo-detected field-swept pulse EPR spectra of the nitroxide and the light-induced quartet state. To obtain the spectrum of the pure quartet state, a small residual nitroxide signal needed to be subtracted from the data. While the nitroxide spectrum is remarkably similar to that measured in isotropic frozen solution (see Figure S5), the intensity of the outer wings of the quartet spectrum (multiplet polarisation) relative to that of the central features (net polarisation) is found to be considerably reduced in polymer films at room temperature (see also Figure S10). The central quartet feature with aea polarisation, which dominates the appearance of the corresponding frozen solution spectrum, can, however, clearly be recognised and identified. To confirm the assignment of this feature to the quartet |m S = + 1 2 ⟩ ↔ |m S = -1 2 ⟩ transition, transient nutation experiments were performed as detailed in the SI and shown in Figure S12. Referenced against the nitroxide signal (pure doublet, ω 0 ), a frequency of 2 ω 0 was determined experimentally, as would be expected based on ω m S ,m S +1 = ω 0 • S(S + 1) -m S (m S + 1), [START_REF] Astashkin | Electron-spin transient nutation: a new approach to simplify the interpretation of ESR spectra[END_REF][START_REF] Mizuochi | A two-dimensional EPR nutation study on excited multiplet states of fullerene linked to a nitroxide radical[END_REF][START_REF] Mizuochi | First observation of the photoexcited quintet state in fullerene linked with two nitroxide radicals[END_REF] leaving no doubt about the quartet nature of the observed signal. The ratio of the nitroxide and quartet coherence times is found to be similar compared to that in frozen solution (4.4 µs/2.6 µs = 1.7 vs 1.1 µs/0.7 µs = 1.6), supporting our previous statement that these coherence times might be directly correlated.

Although the coherence time of the quartet state is reduced by a factor of about four at room temperature compared to the measurements at 80 K, the measured T m value of 0.7 µs at 295 K still compares favourably with values reported for other molecular spin qubit candidate systems investigated under ambient conditions. [START_REF] Atzori | Room-temperature quantum coherence and Rabi oscillations in vanadyl phthalocyanine: toward multifunctional molecular spin qubits[END_REF][START_REF] Bader | Room temperature quantum coherence in a potential molecular qubit[END_REF] In addition, the investigated system represents the only photogenerated molecular system studied so far under these conditions and we expect that an optimisation of the film preparation conditions (molecular packing) and/or the choice of a different polymer host material may lead to a further enhancement of T m .

To demonstrate the possibility of a coherent manipulation of the photogenerated spin system, Rabi oscillation experiments were carried out in addition to the measurement of the coherence decay, as shown in Figure 4c. The measurements were performed at different microwave attenuations (as indicated in the figure) to demonstrate that the Rabi frequency is linear with the applied microwave B 1 field. For microwave attenuations of 15 dB, 18 dB, and 21 dB, Rabi frequencies Ω R of 16.2, 12.0, and 8.3 MHz were obtained, respectively, demonstrating the linearity and thus confirming that the oscillations are of pure Rabi type. [START_REF] Moreno-Pineda | Molecules as qubits, qudits and quantum gates[END_REF] Considering the measured values for T m and Ω R , the number of single-qubit logic operations, Ω M , feasible with this system under the applied conditions, can be calculated from Ω M = 2 T m Ω R and amounts to ∼ 22. This shows that the quartet state can reach any arbitrary superposition state and can be coherently manipulated for at least 20 rotations at room temperature.

Conclusions

By investigating a series of three PDI-TEMPO dyads, we explored two different strategies to make photogenerated coupled spin systems amenable to a coherent manipulation of the spin state at room temperature using pulse EPR techniques. The latter requires an enhancement of the spin coherence properties which may either be achieved (i) by isotope labelling to limit the coupling to neighbouring protons or (ii) by embedding the molecules into a rigid matrix to limit decoherence by molecular motion.

Isotope labelling of the TEMPO moiety was found to have only a minor influence on the measured spin coherence times. However, it turned out to be a convenient method to investigate the relationship between the coherence time of the radical precursor and that of the photogenerated high-spin state. It appears that any increase in the nitroxide coherence time is directly correlated with a corresponding increase in the coherence time of the quartet state, generated by spin coupling. Since synthetic strategies to enhance the coherence times of stable radicals already exist, this observation may be crucial: We expect that it will provide an important handle for improving the design of photogenerated multi-spin systems and their applications in QIS.

In addition, isotope labelling could be used here to unambiguously confirm the contribution of hyperfine coupling to the shape of the EPR spectrum measured for the coupled system, which was suggested in our earlier work. [START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF] Numerical simulations of the EPR spectra, using a spin Hamiltonian approach, further reveal, that the coupling between the triplet and doublet spin centres, generated after photoexcitation, falls in the upper intermediate coupling regime. Consequently, we could show that this system represents one of the rare examples [START_REF] Moons | W-band transient EPR and photoinduced absorption on spin-labeled fullerene derivatives[END_REF] of covalently-linked photogenerated high-spin systems where it is possible to determine the magnitude of the exchange coupling constant J TR reliably.

Importantly, we demonstrated here that room temperature EPR measurements are well feasible with photogenerated organic multi-spin systems when embedding them in rigid polymer matrices and we expect that the experimental protocols developed in this context will also be transferable to other photogenerated high-spin systems, making them amenable to pulse microwave manipulations at room temperature. To our knowledge, the present study also represents the first observation of room temperature quantum coherence in a photogenerated organic triplet-doublet spin system which exhibits properties that are suitable for applications in the field of quantum information technology, [START_REF] Wasielewski | Exploiting chemistry and molecular systems for quantum information science[END_REF][START_REF] Quintes | Properties and applications of photoexcited chromophore-radical systems[END_REF][START_REF] Mayländer | Exploring photogenerated molecular quartet states as spin qubits and qudits[END_REF][START_REF] Divincenzo | The physical implementation of quantum computation[END_REF] such as quantum sensing. Coherence times close to 1 µs and Rabi oscillations could be measured under ambient conditions, which is a first and necessary step for the integration of such or similar systems in practical molecular spintronic devices.

Supporting Information. Synthetic procedures and characterisation, UV-vis spectra, description of the EPR sample preparation, EPR measurement conditions and parameters, complementary EPR data, details of the data analysis including simulation parameters.

EPR data analysis and simulations, draft editing T.Q.; Synthesis and characterisation of the compounds, draft editing A.V.J.; Conceptualisation, project administration, funding acquisition, supervision of the optical and EPR experiments, original draft writing, data visualisation S.R.

Competing interests. The authors declare no competing interests.

Figure 1 :

 1 Figure 1: Structures of the three investigated PDI-TEMPO dyads (a) and overview of the underlying photophysical scheme (b). The numeric superscripts in panel b indicate the spin multiplicity and the grey arrow pointing from the chromophore excited state to its ground state represents radiationless excited state deactivation by enhanced internal conversion. The black double-headed arrows indicate transitions that can be induced by microwaves.The splitting of the energy levels of the quartet and excited doublet states is shown here for the strong coupling regime and ferromagnetic coupling. In the intermediate coupling regime, doublet and quartet states are mixed, leading to additional transitions.[START_REF] Quintes | Properties and applications of photoexcited chromophore-radical systems[END_REF] Abbreviations: R-radical, T-triplet, EISC-enhanced intersystem crossing, Q-quartet state.

Figure 2 :

 2 Figure 2: TrEPR spectra of the three dyads recorded at the Q-band in isotropic frozen toluene solution at 80 K together with the best numerical fits to the data. The spectra were recorded in direct detection mode (a: enhanced absorption, e: emission). To the right of each spectrum, the relative quartet (Q) sublevel populations are visualised by circles of different sizes. The simulation parameters are given in the text and a detailed overview is provided in the SI (TablesS1-S3).

( 1 )

 1 where τ indicates the inter-pulse delay in the Hahn-echo detection sequence. While the trace for unlabelled PDI-TEMPO shows no discernible nuclear ESEEM effects, clear nuclear modulations with a frequency characteristic for deuterium are superimposed on the decay of the two d 17 -labelled isotopologues. The variations in the measured coherence times are relatively minor, ranging from 3.8 µs for unlabelled PDI-TEMPO to 4.4 µs for PDI-TEMPO-d 17 -15 N. Deuteration of the protons on TEMPO seems to have only a very minor influence, as reflected by the similarity of the decay measured for PDI-TEMPO and PDI-TEMPO-d 17 (4.0 µs vs. 3.8 µs), while the effect of the replacement of 14 N by 15 N is somewhat larger (4.0 µs vs. 4.4 µs).

Figure 3 :

 3 Figure 3: Comparison of the spin coherence times of the nitroxide (a) and quartet state (b) for the three different PDI-TEMPO dyads. The values obtained by fitting of the data using a stretched exponential function are indicated in the figure. The nitroxide coherence times were measured at the intensity maximum of the corresponding field-swept echo-detected EPR spectrum, corresponding to B0 values of 1208.4 mT, 1208.2 mT, and 1208.7 mT for PDI-TEMPO, PDI-TEMPO-d17, and PDI-TEMPO-d17-15 N, respectively. The coherence times of the corresponding quartet states were measured at a field position corresponding to the central emissive line, i.e. B0 values of 1210.5 mT, 1210.3 mT, and 1210.5 mT. All magnetic field values refer to a microwave frequency of exactly 34.0 GHz.

Figure 4 :

 4 Figure 4: Illustration of the coherent spin properties of the molecular quartet state of PDI-TEMPO-d17-15 N in a PMMA host matrix at room temperature. Room temperature Q-band pulse EPR spectra of the nitroxide and quartet state (a), spin coherence decays measured for the nitroxide and quartet state (b), and Rabi oscillation experiments on the quartet state recorded at different microwave attenuations (c). The coherence time of the nitroxide and the coherence time and Rabi oscillations for the quartet state were measured at a magnetic fields of 1208.7 mT and 1210.5 mT, respectively, referring to a microwave frequency of 34.0 GHz.

Acknowledgements. This work was supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) -Project number 417643975. The authors would like to thank the SIBW/DFG for financing EPR instrumentation that is operated within the MagRes Center of the University of Freiburg (grant no. INST 39/928-1 FUGG). A.V.J. acknowledges support by the CNRS via the Emergence@INC program. We would further like to thank Prof. Thorsten Hugel for providing us access to his steady state fluorescence and fluorescence quantum yield spectrometers.

Author contributions. Spectroscopic characterisation of the compounds, EPR data acquisition and analysis, draft editing and data visualisation M.M.; Establishment of the methodology for the preparation of polymer film samples suitable for Q-band pulse EPR measurements at room temperature, EPR sample preparation, draft editing P.T.;