원시데이터 수집 시스템
선정목록으로

A Python Toolbox for Unbiased Statistical Analysis of Fluorescence Intermittency of Multilevel Emitters

관련 수소연료전지 · (6) PEM(고분자전해질막)

기본 정보

저자
  1. Isabelle M. Palstra — Institute of Physics, University of Amsterdam, Science Park 904, 1098 XH Amsterdam, The Netherlands|||Center for Nanophotonics, AMOLF, Science Park 104, 1098 XG Amsterdam, The Netherlands
  2. A. Femius Koenderink — Center for Nanophotonics, AMOLF, Science Park 104, 1098 XG Amsterdam, The Netherlands
DOI
10.1021/acs.jpcc.1c01670
저널
The Journal of Physical Chemistry C
발행년도
2021
발행기관
American Chemical Society
피인용수
10
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1021/acs.jpcc.1c01670
토픽
Conducting polymers and applications
OpenAlex ID
W3165597837

평가 내용

관련도
관련
사업분야
수소연료전지 · (6) PEM(고분자전해질막)
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '수소연료전지 > PEM(고분자전해질막)' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

We report on a Python toolbox for unbiased statistical analysis of fluorescence intermittency properties of single emitters. Intermittency, that is, step-wise temporal variations in the instantaneous emission intensity and fluorescence decay rate properties, is common to organic fluorophores, II–VI quantum dots, and perovskite quantum dots alike. Unbiased statistical analysis of intermittency switching time distributions, involved levels, and lifetimes are important to avoid interpretation artifacts. This work provides an implementation of Bayesian changepoint analysis and level clustering applicable to time-tagged single-photon detection data of single emitters that can be applied to real experimental data and as a tool to verify the ramifications of hypothesized mechanistic intermittency models. We provide a detailed Monte Carlo analysis to illustrate these statistics tools and to benchmark the extent to which conclusions can be drawn on the photophysics of highly complex systems, such as perovskite quantum dots that switch between a plethora of states instead of just two.

본문 80,058자

본문 펼치기
We report on a Python-toolbox for unbiased statistical analysis of fluorescence intermittency properties of single emitters. Intermittency, i.e., step-wise temporal variations in the instantaneous emission intensity and fluorescence decay rate properties are common to organic fluorophores, II-VI quantum dots and perovskite quantum dots alike.Unbiased statistical analysis of intermittency switching time distributions, involved levels and lifetimes is important to avoid interpretation artefacts. This work provides an implementation of Bayesian changepoint analysis and level clustering applicable to time-tagged single-photon detection data of single emitters that can be applied to real experimental data and as tool to verify the ramifications of hypothesized mechanistic intermittency models. We provide a detailed Monte Carlo analysis to illustrate these statistics tools, and to benchmark the extent to which conclusions can be drawn on the 1 arXiv:2102.11044v3 [physics.comp-ph] 5 May 2021 photophysics of highly complex systems, such as perovskite quantum dots that switch between a plethora of states instead of just two. Introduction Since the seminal first observation of single molecule emitters in fluorescence microscopy three decades ago, 1 single quantum emitter photophysics has taken center stage in a large body of research. On one hand, single quantum emitters as single photon sources 2 are held to be an essential part of quantum communication networks and are deemed essential for building optically addressed and cavity-QED based quantum computing nodes. 3 This has particularly spurred research in III-V semiconductor quantum dots, 4,5 color centers in diamond, silicon carbide and 2D materials, [6][7][8] and organic molecules at low temperature. 9 On the other hand, classical applications of ensembles of emitters for displays, lighting, lasers and as microscopy-tags drive the continuous development of new types of emitters, such as II-VI self-assembled quantum dots 20 years ago, [10][11][12] and inorganic perovskite quantum dots just recently. [13][14][15][16][17][18][19][20] For all these systems, understanding the photophysics on the single emitter level is instrumental, whether the intended use is at the single or ensemble level. Introduction A common challenge for almost all types of emitters is that they exhibit intermittency, also known as blinking. 21,22 Under constant pumping emitters switch, seemingly at random, between brighter and dimmer states, often corresponding with higher and low quantum yield (QY), and different fluorescence decay rates. Frequently the switching behavior also shows peculiar, power-law distributed, random distributions of durations of events. Determining the mechanism through which emitters blink, i.e., the origin of the involved states, the power-law distribution of residence times, and the cause of switching, have been the topic of a large number of studies particularly for II-VI quantum dots as recently reviewed by Efros and Nesbitt. 23 Recent studies on inorganic perovskite quantum dots uncover intermittency behavior that does not fit common models for intermittency in their II-VI counterparts. [14][15][16][17][18][19][20] time stamps CPA Grouping Figure 1: A schematic overview of the working of the toolbox. (A) An illustration of the two methods available to obtain TCSPC data, either by photolumiescence TCSPC measurements of a single emitter (top panel) or through simulation of a single emitter (bottom panel). The latter is provided in the toolbox. Both will result in a stream of timestamps that can then be further analyzed by the toolkit. The simulation part of the toolbox simulates dots of m 0 levels, with associated count rates and fluorescence decay rates I m and γ m , with the dot visiting levels in random order, and with residence times for each segment chosen drawn according to specified power law exponents α m . The output simulated data consists of time stamped photon arrivals over a total time span T , where for each photon k = 1 . . ., a time stamp s k is recorded. These time stamps are randomly distributed over two detector channels S A , S B . The delays of each of the photon time stamps relative to the time stamp in the third channel S R , representing the periodic pump laser pulse train, is chosen in accordance with the set emitter decay rate. (B) Starting out with this stream of photon events, using CPA (C), the changepoints are found, and with these, the instantaneous intensities. (D) Subsequently, these events are grouped in order to find the most likely underlying intensity levels between the behavior. Following this, a number of analyses can be done, such as (E) ascertaining whether the time between switching events is powerlaw distributed, (F) the visible separation of states in FDID/FLID (fluorescent decay rate intensity diagrams, resp. fluorescent lifetime intensity diagrams), and (G) the presence of memory in the switching behavior. Here we show an example of a simulated, 4 level emitter, with simulation parameters chosen for clarity of illustration. Introduction In order to quantify intermittent behavior, the simplest and most commonly employed method is to subdivide a measurement stream of individual photon-arrival times into short bins of a few ms, to calculate the intensity (in counts/second) of each bin. Every bin can then be assigned to a state (on, off or grey) according to its brightness so that on/off times as well as intensity levels can be defined and analyzed. 21 For pulsed laser excitation, also quasi-instantaneous fluorescence decay rates can be obtained. 24,25 However, it is well known that this method of binning time streams and histogramming binned intensities causes detrimental artefacts. 21,[26][27][28][29][30][31][32] Retrieved parameters of the quantum dot behavior often exhibit a dependency on the choice of the bin width, which affect estimates of switching time distributions and power laws,and also the objective assignment of intensities to intrinsic levels. Introduction Narrower bin widths in principle allow better resolution, but run into shot noise limits, while conversely choosing larger bins suppresses noise, but will render the analysis blind to fast events. To overcome these issues, Watkins and Yang 26 proposed changepoint analysis (CPA) as a Bayesian statistics approach for the unbiased determination of switching times that is optimal, i.e., gives the best performance given the constraints of shot noise in the data. Changepoint analysis and clustering is one example of Bayesian inference methods to determine the transitions and underlying levels in single photon trajectories. In the domain of high-throughput single-molecule analysis 33 many methods to process single photon trajectories have appeared, that one can classify as supervised learning methods with a priori model assumptions on one hand, and unsupervised approaches on the other hand. Prominent are socalled hidden Markov Model (HMM) methods 34 that view photon data streams as experimentally measured output of transitions between hidden transition states. Bayesian inference can then estimate parameters such as transition probabilities if one a priori postulates the number of levels and the allowed transitions. As this underlying model is a priori often not known, one can apply HMM with different possible models, and rank them according to probabilistic criteria, such as the Bayesian Information Criterion. Also, the requirement for a priori known models is relaxed in socalled aggregated Markov models, 35 and non-Markov memory kernel models. 36 Juxtaposed to such supervised analysis methods are unsupervised approaches. Such methods apply changepoint analysis to partition data into time segments between jumps, and subsequent clustering of intensity levels. The CPA method pioneered by Watkins and Yang is essentially such a combination of changepoint detection and hierarchical agglomerative clustering, using the Bayesian Information Criterion to determine the best clustering of measured intensities in distinct levels (states) with as sole assumption that intensity in each segment of time wherein the emitter is in a given level, the counts are Poisson distributed. 26,29 A main drawback is that particularly the clustering is slow. We refer to Ref. 37 for recent developments in machine learning to mitigate this problem. A main advantage of CPA is that no underlying model is required, and that the data is segmented and clustered to the level that the data allows, given that the data is Poisson distributed in intensity, and given a required confidence level stipulated by the user. Introduction Variations on CP for other types of noise, such as Gaussian noise, have also appeared. 38,39 Despite the well-documented superior performance over binning of photon counting data, in the domain of single photon counting data from quantum dots only very few groups have adopted these methods. 17,26,28,29,32,40,41 In this paper, we provide, benchmark, and document a Python toolbox for changepoint analysis, state clustering, and analysis of fluorescence-intensity-decay rate correlations that is posted on GitHub. 42 A main motivation lies in the emergence of new quantum emitter systems with complex photophysics. While II-VI quantum dots for which CPA was orginally developed, are generally understood to switch between just two or three states, the problem of accurate analysis of intermittency is gaining in prominence with the advent of novel emitters, such as perovskite quantum dots which appear to switch not between just two, but instead a multitude of states. [14][15][16][17][18][19][20] There is hence a large need for a toolbox that provides unbiased, model-free analysis of photon counting data, for which reason we provide a CPA implementation and benchmark it for complex multilevel emitters. Our toolbox is both applicable to real quantum dot data, and valuable as a testbed for both testing models and analysis techniques on synthetic, i.e., numerically generated data. Indeed, the code toolbox we supply includes code to generate numerically random photon time arrival data streams for 'synthetic' quantum dots that jump between an arbitrary set of intensity levels and decay rates, with jump time statistics and photon budgets that can be set by the user. As results we provide benchmarks on the performance of CPA for detecting change points in function of the number of intensity levels and total photon budget, and we explore the limits to the number of distinct states that the clustering analysis can reliably separate. Moreover, the toolbox allows to us test the accuracy of jump time statistics, such as power law statistics, for such multilevel dots. Finally, the test suite also allows to benchmark the accuracy of fluorescence decay model fitting with maximum likelihood estimation, and we discuss the construction of fluorescence-intensity-decay rate correlations from CPA-partitioned data. The applicability of the toolbox to experimental data is illustrated by supplied data sets, which correspond to a related paper in this journal. 43 We note that some other approaches such as HMM methods may be more suited for processes where more knowledge on the underlying physical processes is available. In contrast our toolbox is ideal for cases in which one wants to make no a priori assumption on the physical mechanism behind intermittency. Furthermore, the CPA method in the toolbox operates on the finest level of information available in photon counting, i.e.. the distribution of individual photon arrival times, as opposed to methods that are optimized to work on camera frame data. 33 This paper is structured as follows. In the Methods section we summarize the Bayesian statistics tools we implemented to analyze all aspects of our data. Introduction Next, we benchmark the performance of changepoint analysis to pinpoint intensity jumps, and of level clustering to identify the number of levels between which a dot switches on the basis of Monte Carlo simulations. Next we present considerations on the dependence of on-off time distributions, decay rate fit and so-called 'fluorescence decay-rate versus intensity diagrams'(FDIDs) on count rates. Methods In this section we present all the methods implemented in our Python toolbox, as well as the methods for benchmarking them. Benchmark results are presented in the results section. Methods We refer to the supporting information for a manual to the code and the code itself. Changepoint analysis First, we summarize changepoint analysis (or CPA), a Bayesian statistics method for the unbiased determination of jumps or 'changepoints' in time traces of discrete events. 17,26,28,29,32,39,41,[44][45][46][47][48] Bayesian statistics is a paradigm that reverses the usual standpoint of probability theory. Changepoint analysis Usual probability theory views a data set as a random draw from a probability distribution, given a hypothesis on the parameters of the underlying physical process. In this framework, one can calculate the likelihood of drawing the specific measured data set. Bayesian statistics, on the other hand, compares the likelihood of distinct hypotheses, given a measured data set and assumptions on the underlying measurement noise. Changepoint analysis We consider time-tagged single photon counting data consisting of an ordered list of measured photon arrival times s k , collected over a measurement time T . For a single emitter with no memory that emits at a count rate of N photons in a time T , the waiting times -i.e., the times between photon arrivals -are exponentially distributed with waiting time τ w = T /N . In order to determine whether there is a changepoint in some segment q, CPA compares the likelihood of two distinct hypotheses, (1) there is a jump in emission intensity (i.e. the average waiting time τ w jumping from some value to another) against (2) there is the same intensity throughout the measurement interval. When testing for a jump at photon detection event k at time s k in this trajectory q with time duration T q containing N q photon events, this leads to a log-likelihood ratio, or 'Bayes factor' 26,28,29 Changepoint analysis where V k = s k /T q . Derivation of this log-likelihood ratio involves several steps. First, it incorporates the assumption that in between jumps, the waiting time between photons is exponentially distributed, on basis of which one can assess the likelihood of measuring the given data set for a given hypothesis on the exponential waiting time τ w . Second, it uses maximally non-informative priors for L k to compare the hypothesis of presence versus absence of a changepoint without further restrictive assumptions on the involved intensity levels. Changepoint analysis It should be noted that there are other ways to arrive at the same log-likelihood ratio test. One alternative starting point is a binary time series in which there is an underlying uniform and small probability distribution of photon detection per bin (e.g., imagining the time axis binned in by the timing card resolution (of order 0.1 ns for typical hardware)). 40 Such a uniform distribution would emerge as a direct consequence of exponential waiting time distributions. In this case one should start from a binomial distribution and ultimately arrives at the same formula after application of Stirling's formula. Another starting point is CPA applied to binned data with wider bins with multiple counts, i.e. to series of Poisson distributed intensities instead of discrete events. 26,29 However, the binning would introduce an undesirable time scale through the chosen bin width. Of these three methods, working with photon arrival times is the most data efficient approach and introduces no artificial partitioning whatsoever. We refer to Ref. 29 for a derivation of the log-likelihood ratio in all these three scenarios, which includes a precise description of the use of maximally noninformative priors. Changepoint analysis Following Watkins and Yang 26 and Ensign, 29 the most likely location of a changepoint, if any, is at the k that maximizes the Bayes factor L k . The hypothesis that this most likely changepoint is indeed a real event is accepted if L k exceeds a critical threshold value for L k or 'skepticism'. This value is chosen to balance false positives against missed events. A full data set is partitioned recursively, i.e., by recursively checking if data sets between two accepted changepoints themselves contain further changepoints. This results in a division of the data set into segments, each of which starts and ends at an accepted changepoint, and with the level of skepticism as stop criterion for the recursion. The resulting segmentation provides the most likely description of data as consisting of segments within which the intensity is constant, given the value chosen for the degree of 'skepticism', and given the amount of data collected. Since the algorithm works with the list of individual photon arrival times this segmentation entails no arbitrary partitioning. An accepted rule of thumb is that if the Bayes factor L k exceeds a 'skepticism' value of just between 1-3, the evidence for a changepoint is highly ambiguous, while values in the range 7-10 are deemed strong evidence Changepoint analysis The toolbox is supplied with a default value of skepticism of 8, set following the analysis of 26 and . 29 The reader is warned that for a given photophysics scenario (intensity levels, segment simultaneously and iteratively optimize the probability p mq for segment q to belong to the mth level, as well as an estimate of the intensities of these levels I m . In each iteration the intensities of all levels are estimated from the level assignment from p m,q . Following this, the probability distribution p mq is updated to redistribute the segments over the levels. In this calculation it is important to understand the type of noise statistics the data obeys. In the case of single-photon measurements, and for the purpose of this discussion, the intensities are Poisson distributed. The iteration is repeated until p mq converges (practically also capped by a maximum number of iterations). The final outcome is a most likely assignment of the measured segments into n G levels. Next for each value of nG one asseses the 'Bayesian information criterion' (BIC). This criterion is a measure for how good the description of the segmented intensity trace is with n G intensity levels given the assumption of Poisson counting statistics for each fixed intensity level. Beyond a mere 'goodness of fit' metric that would simply improve with improved number of parameters available to describe the data, this metric is penalized for the number of parameters to avoid overfitting. For Poisson distributed data the criterion is derived in 26 as Changepoint analysis where Q again is the number of change points detected, n G is the number of available levels. Changepoint analysis The term L EM is the log-likelihood function optimized in the expectation maximization step, i.e L EM = q n G m=1 p mq ln[p m P(I q ; I m )] with P ( x; λ) the Poisson probability function at mean λ, p m the probability of drawing level m. The second term in the BIC s the term penalizing the BIC for overfitting. The accepted best description of an emitter in n G -levels is taken to be at the value of n G where the BIC peaks. Changepoint analysis Intensity cross/autocorrelation and maximum likelihood lifetime fitting Many single photon counting experiments are set up with pulsed laser excitation for fluorescence decay rate measurements, and with multiple detectors to collect intensity autocorrelations (e.g., to verify antibunching in g (2) (τ ) for time intervals τ comparable to the fluorescence decay rate, and shorter than the commonly longer detector dead time). In a typical absolute-time tagging set up, this results in multiple data streams S A , S B , S R of time stamps corresponding to the detection events on each detector, and the concomitant laser pulses that created them, respectively. Our Python toolbox contains an implementation of the correlation algorithm of Wahl et al. 49 that operates on timestamp series, and returns, for any combination of channels S 1 , S 2 (1, 2 ∈ {A,B,R}), the cross correlation C(τ )∆τ , i.e., the number of events in the time series S 1 and the time series S 2 that coincided when shifted over τ , within a precision ∆τ . Changepoint analysis Cross-correlating detected photons and laser arrival times, taking ∆τ to be the binning precision of the counting electronics and the range of τ equal to the laser pulse repetition rate, returns a histogram of the delay times between photon detection events and laser pulses. To obtain g (2) (τ ) to investigate antibunching, streams of photon events from two detectors in a Hanbury-Brown Twiss set up are cross-correlated. ∆τ is taken to be the binning precision of the counting electronics and the sampled range of τ as an interval is taken symmetrically around τ = 0 and several times the laser pulse interval. Finally auto-or cross correlating detector streams over τ -ranges from nanoseconds to seconds, coarsening both τ and ∆τ to obtain equidistant sampling on a logarithmic time axis, results in long time intensity autocorrelations of use in intermittency analysis. 31 Our toolbox also provides this logarithmic time-step coarsening version of the correlation algorithm of Wahl et al. 49 Of particular interest for intermittent single emitters is the analysis of fluorescence decay rates in short segments of data as identified by changepoint analysis, that may be so short as to contain only 20 to 1000 photons. For each of the photon detection events in a single CPA segment, cross-correlation with the laser pulse train yields a histogram of the N q photons in segment q. In each of the bins (with width ∆τ ) the photon counts are expected to be Poisson distributed. Therefore the optimum fit procedure to extract decay rates employs the Maximum Likelihood Estimate procedure for Poisson distributed data, as described by Bajzer et al. 50 In brief, for a decay trace sampled at time points τ i relative to the laser excitation, with counts per bin D(τ i ), the merit function reads Changepoint analysis Assuming a chosen fit function F A (t) the parameter set A that minimizes this merit function provides the parameter values that most likely correspond to the data. The estimated errors in these parameters then follows from the diagonal elements of the inverse of the Hessian of M relative to the parameters A. Importantly, the fact that the Poisson distribution is tied to absolute numbers of counts, implies that this approach requires that the data is neither scaled nor background subtracted. Instead, the background should be part of the fit function either as a free parameter or a known constant. Furthermore, it should be noted that time bins with zero counts are as informative to the fit as non-empty ones, and should not be left out. Generating synthetic quantum dot data To benchmark the CPA and clustering method and to test its limits, our toolbox provides an example routine to generate artificial data mimicking quantum dot intermittency. To obtain mimicked quantum dot data, we first choose a number m 0 of intensity levels I 0,m between which we assume the dot to switch. Next we generate switching times for each of the states. In this work, we choose all switching times from a power law distribution. Generating synthetic quantum dot data For benchmark purposes we will present results with power law exponent α = 1.5, though any exponent can be set in the code. On the assumption that intensity levels appear in a random and uncorrelated order, this segments the time axis in a list of switching events T 0,j , j = 1, 2, . . . m 0 , where for each segment we randomly assign one of the nominal intensities I 0,m . Next, to mimic a pulsed excitation experiment, we imagine each of these segments to be subdivided in intervals of length τ L equivalent to a laser repetition rate (τ L = 100 ns Generating synthetic quantum dot data in the examples in this work). We assign each of these intervals to be populated with one photon at probability p m = I 0,m τ L . This ensures that the number of photons N q in every segment is drawn from a Poisson distribution at mean T 0,q I 0,m . By removal of all empty bins, the binary list is translated into a list S = (t 1 , t 2 , t 3 , . . .) of photon arrival time stamps at resolution τ L to which one can directly apply CPA to attempt a retrieval of switching times, and apply clustering to retrieve the number of states. Generating synthetic quantum dot data To also enable fluorescence decay rate analysis, we further refine the photon arrival time list. Recalling that we have generated switching events T 0,q between intensity states I 0,m , we now also assume fluorescence decay rates γ 0,m . As each segment q, was already chosen to correspond to some level m q , we now impose decay rate γ 0,mq on the photon arrival times. To do so, for each of the photon events k = 1 . . . N q already generated at resolution τ L we now randomly draw a delay time ∆ k relative to its exciting laser from an exponential distribution characterized by rate γ 0,mq . To mimic the behavior of typical TPSPC counting equipment, the delay time is discretized at a finite time resolution ∆τ (in this work chosen as 165 ps to match the hardware in the provided example experimental data measured in our lab (Becker & Hickl DPC-230), though of course in the toolbox the value can be set to match that of any TCSPC card vendor). Testing of fluorescence decay trace fitting can operate directly on the generated list of delay times, or alternatively one can synthesize a TCSPC experiment by re-assigning S to represent laser-pulse arrival times S R , and defining photon arrival times as the events in S A , S B each shifted by its delay time, i.e. S X = (t 1 + ∆ 1 , t 1 + ∆ 2 , . . .),with X ∈ A,B. Cross correlation of S R and S X returns the delay time list. We note that although our work does not focus on antibunching, our quantum dot simulation routine provides data distributed over two detector channels, where emission events antibunch, while an uncorrelated background noise level of the detectors can also be set. Practical implementation We have implemented the toolbox ingredients in Python 3.8. As timestamp data can be substantial in size, we use the 'parquet' binary format to store timestamps as 64-bit integers. Processing and plotting the data is dependent on Pythons' standard libraries numpy, matplotlib, while we use Numba, a just-in-time compiler, to accelerate the time-stamp correlation algorithms. An example script to generate synthetic data, and to run the entire workflow on simulated data is provided. We refer to the supporting information for a guide to the practical implementation and use of our toolbox. The toolbox comes also with example experimental data on single CsPbBr 3 quantum dots from a recent experiment 43 under review at the same journal for intended back to back publication. Table 1 list scaling and performance metrics for the algorithms contained in the toolbox. Results The remainder of this work is devoted to presenting benchmarks of the provided methods. Results Benchmarks for emitters with 'binary' switching, i.e., two well-separated intensity levels as is typical for II-VI quantum dots, have already been presented in literature. 26,32,40 However, Results Ca. 10 s for N = 10 6 Grouping Initial clustering dominates over iterative algorithm Results Overhead dominated 0.75 ms per iteration (Q < 500) Results O(N n plot points ) 8 ms per plot point at N = 10 6 Long-time autocorrelation 4 O(N n cascade ) Ca. 2s for full plot 1 For large Q this is accelerated by first clustering subsets, merging, and continuing clustering 2 Typically 5 to 10 iterations are required when n G ≈ m. 3 Numba JIT acceleration assuming int64 provides over 2 orders of magnitude accelation. A typical g (2) plot has ca. n plot points ) = 2000, and hence requires 10 to 20 seconds to evaluate. 4 Essentially repeating g (2) and logarithmic coarsening every n cascade points. Results emitters under current study, such as perovskite quantum dots appear to have a multitude, or perhaps even a continuum, of intensity levels. Our tests hence focus on determining the performance of CPA and level clustering for many-level single photon emitters. Purely for visualization purposes, the data is plotted in a binned format, as the analysis itself does not make use of any binning. Alongside the binned intensity trace, we also show the log-likelihood ratio L k . In both cases, the log-likelihood ratio clearly peaks at or close to the point where there is a changepoint in the data. Since the Bayes factor is actually a logarithmic measure for the comparison of hypotheses, the algorithm indeed identifies the changepoint with high probability and to within just a few photon events, even where the jump is far smaller than the shot noise in the binned representation in the plot, at a relative Figure 2: Demonstration of changepoint detection applied to a synthesized data set with a single changepoint, with equal photon counts before and after the changepoint. In (A) and (B) the contrast between intensities is a factor of 10 and 2, respectively, while the total photon budget is approximately 2000 and 300. The bottom panels show the log-likelihood ratio test, which clearly peaks at the changepoint in both cases. The y-axis unit cts/ms stands for counts per millisecond. The robustness of the method is demonstrated in (C) and (D), where we show the likelihood of detecting a changepoint in such a series for different intensity contrasts, and the variance of the found times, respectively, as a function of the total photon numbers. To gather accurate statistics, 10 4 photon traces were generated for each data point. The data is plotted in a binned fashion (ms bins) for visualization purposes only. Precision of identifying individual changepoints intensity contrast of just a factor of 2. Generally, the probability with which the algorithm identifies or misses the changepoint is dependent on the total number of photons recorded both before and after the changepoint, and on the contrast in intensities, consistent with the findings of Watkins, and Ensign. 26 To identify the limits of CPA 29,32 we consider the feasibility of identifying changepoints of contrast I 2 /I 1 as function of the total number of photons in the time record. The results are shown in Figure 2C for the likelihood of detecting a changepoint, and Figure 2D Intermittency and on-off time histograms The input shows the initial power-law distribution, the lighter colors show the number of retrieved changepoints, after applying Poisson noise and CPA, at different contrasts, with I 1 = 10 5 . counts/s. We can see that even at low contrast, events with long times between switching are retrieved, but each contrast has a characteristic duration below which changepoints can't be accurately retrieved. This puts a fundamental limit on the information that can be extracted from a given data set. (D) An occupancy diagram illustrating the behavior of the clustering algorithm for a system with m 0 =4 intensity levels. The color scale indicates the amount of time spent in each state m i after the assignment of states for a given number of available states n G . We see that when n G > m 0 , effectively all segments are distributed across only n G ≤ m 0 intensity levels. Precision of identifying individual changepoints As next step in our Monte Carlo benchmarking we turn to time series with many, instead of single, jumps. Fig. 3A shows a representative example for a simulated intermittent quantum dot with two states, assuming a contrast ratio between states of 2 × 10 4 and 5 × 10 3 s −1 . We generally observe that the recursive CPA algorithm accurately identifies switching events, barring a number of missed events of very short duration. From the CPA analysis we retrieve the time duration between switching events. Figure 3C shows a histogram of time durations, plotted as a probability density function obtained from a whole series of Monte Precision of identifying individual changepoints Carlo simulated time traces of varying contrast between states (see legend). Noteably, if we simulate quantum dots that have switching times that are power-law distributed, the retrieved distribution indeed follows the assumed power-law particularly for long times. At shorter times, the histogram remains significantly below the power law, particular at low intensity ratios between the two assumed states. This indicates that CPA misses fast switching events, and is consistent with the observation from Figure 2C Error analysis for trajectories with multiple jumps The changepoint analysis results in Figure 2(C) essentially quantifies the algorithm performance in terms of the fraction of correctly identified change points (true positives) for traces with a single step in intensity, as function of contrast and photon budget. Actual single emitter photon trajectories have a plethora of steps, where CPA is mainly likely to miss short segments due to the fact that only those changepoints are accepted for which the evidence in the data is compelling, relative to the shot noise in it. Indeed, the short-time rolloff in Figure 3C highlights exactly this tendency of CPA to under-report on closely-spaced changepoints (false negative rates high for short segments). The level of skepticism set as parameter for running CPA sets the overall accuracy of the algorithm, essentially trading off the rates of false positives, and false negatives. When using the toolbox for a particular photophysical scenario, the reader is recommended to study the error rates as function of skepticism. To demonstrate that type of study, here we report on algorithm performance as function of skepticism using the error metrics accuracy, precision and recall. To this end, we generate synthetic data and match the list of nominal changepoints and retrieved change- each. If the time axis for the tolerance is chosen as short as the inverse mean count rate, the apparent algorithm precision is low, indicating that changepoints are generally found close to, but not quite at, the moment where the switching event occurs. At tolerances of 2 to 5 ms (containing of order 50-250 photons typically at the given rate, and for the various assumed intensity levels) the error rate saturates at above 90%. The accuracy for this example peaks at a skepticism of ca. 7.0 ( Figure 4A). At higher levels of skepticism, the precision increases, Error analysis for trajectories with multiple jumps i.e., the number of false positives reduces further ( Figure 4B). However, this is at the expense of recall, i.e., the number of missed changed points. The false negatives rate decreases only with skepticism lowered to below 10 ( Figure 4C). Performance of level clustering Next we consider the performance of the grouping algorithm applied to the segmentation of simulated time traces. For reference, Figure 5A shows the Bayesian Information Criterion versus n G for the example of simulated dots with m 0 = 2, 3, 4 intensity levels. Generally, the BIC rapidly rises as n G approaches the actual number of levels with which the data was The most likely number of levels is indicated by a small peak in L k . In the inset, we show that the distributions indeed peak at their respective m 0 . It should be noted that the BIC shows a very sharp rise, and then from m 0 onwards appears almost flat. There is in fact a shallow downward slope. Here one should keep in mind that the BIC is a logarithmic metric. On a linear scale the maximum is significant. (B-E) Likelihood P of finding m r levels for a simulated system, given m 0 initial intensity levels and N the mean number of photon counts. We see that the photon budget plays a defining role in the total number of states that one can reliably resolve. At low photon budgets, the number of levels is systematically underestimated, whereas at high photon budgets, P (m i = m 0 ) remains high even at high m 0 . We see that m r is never overestimated. Performance of level clustering to the penalization of the BIC by the number of fit parameters. Since the BIC criterion actually relates to the logarithm of the probability with which n G states are the appropriate description of the data, even an apparently gentle maximum in BIC actually coincides with an accurate, unique determination of m 0 . Performance of level clustering To gauge the accuracy of the retrieval of the number of states for multi-state quantum dots, we simulated quantum dot data with power-law distributed (α = 1.5) switching events, assuming switching between fromm 0 = 2 to 10 equally likely levels, where we assumed intensity levels to be assigned to segments randomly, and where we assumed levels for simplicity evenly spaced from dark to bright. Lastly, all segments were reassigned an intensity according to Poisson statistics. In other words, we added shot noise. Figures 5D, E), the retrieval of the number of states is indeed robust, even for simulated dots that switch between as many as 10 intensity levels. At low total photon budgets ( Figures 5B, C), we see that m r is often underestimated. This signifies that there is high uncertainty due to shot noise in the assigned intensity levels, so that levels can not be discriminated within the photon budget. It is remarkable that at photon budgets of 10 6 photons, as many as 10 intensity levels can be robustly discerned even though the smallest contrast between levels is as small as 10% in intensity in view of Fig. 2, where it is evident that detecting changepoints for small intensity jumps is difficult. Here, however, one should realize that in contrast to Fig. 2C, where single small-contrast changepoints are studied, here many levels are visited in a random order. Thus the correct detection of small level differences is not reliant on the detection of small changepoint contrasts, but on having sufficient photon statistics to resolve the segment count rates of already identified segments. Performance of level clustering As a secondary metric, additional to the BIC, is in how the clustering algorithm assigns occupancy to the levels. The clustering algorithm assigns to each data segment the most likely intensity level that it was drawn from. Occupancy is a metric for how often each of the n G levels available to the algorithm is actually visited by the measured intensity sequence. Performance of level clustering We find that if one allows the clustering algorithm to use more levels than originally used to synthesize the quantum dot data (n G > m 0 ), the additional levels take essentially no occupancy. We show this in Figure 3D for an example of a dot assumed to have four intensity levels with a total photon count of 5 × 10 5 . As soon as additional states (m ≥ 5) are offered to the grouping algorithm, these additional states take no occupancy and do not change the distribution of segments over the states found at the correct m. Thus we confirm again that the grouping algorithm does not over-estimate the number of states. This limit of our benchmarking space zooms in on the regime where CPA intrinsically fails ( Fig. 2(C)). In this regime, the originally assumed bimodal quantum dot behavior no longer results in a bi-modal FDID. Instead a significant broadening is evident. We can conclude that for most realistic quantum dot systems, CPA-generated FDIDs will not suffer from this artificial broadening artefact. Conclusion In this work, we have provided a Python toolbox for change-point analysis, and for determining the most likely intensity level assignment for intermittent multilevel emitters. We investigated the limits of changepoint analysis and clustering as fundamentally set by photon budget, and for the case of many state emitters. We have shown that for long switching times, the typical power-law behavior of many quantum emitters can be accurately retrieved. Conclusion We also show that in the case of many-state emitters, the number of intensity levels can be retrieved with high fidelity, provided the photon count is high enough. At low photon counts, the number of states is systematically underestimated. This shows in which way the photon budget puts a fundamental limit on the amount of information that can be retrieved from a given TCSPC data set. We show that the photon budget also poses a limitation on the accuracy at which the slope of a single-exponential decay can be retrieved. Additionally, we investigate the commonly used intensity-decay time diagrams. We show that with CPA, a two-state simulated quantum dot is well-represented in an FDID, but when a cutoff is introduced to match that commonly found in literature, the states become increasingly poorly defined in an FDID representation. While the Bayesian inference algorithms in this toolbox were reported earlier for application to quantum dots with just two or three intensity states, this toolbox and the provided benchmarks point at the applicability even to emitters that jump between many closely spaced intensity levels, which will, in our view, be of large practical use for many workers analyzing the complex photophysics of, e.g., perovskite quantum dots. Also, the toolbox can be used for theory development, following a workflow in which hypotheses are cast in synthetic photon counting data, which in turn can be subjected to the CPA analysis suite, to assess how hypothesized mechanisms express in observables, and in how far they are testable. The limit of this testability generally depends on an interplay of total photon budgets, residence time in each level, intensity contrast between levels, and segment durations. For a given photophysics scenario, the user can easily deploy the toolbox to directly assess data segmentation in terms of accuracy, precision and recall error rates, in dependence of the level of skepticism that the user wishes to apply in order to accept assertions regarding the segmentation of data in segments and intensity levels. These error rates, and hence the testability of a hypothesized photophysics scenario, are ultimately limited by the evidence in the counting statistics, and not the segmentation algorithm. Supporting Information Available Detailed manual to the code and description of the example data set. Supporting information -manual to the Python code In this supplement, we will discuss the different uses of the Python toolbox for unbiased statistical analysis. The toolkit accepts both data taken in a TCSPC measurement and data created in Monte-Carlo (MC) simulations. The code, and this manual are. We will first discuss the data processing of photon time stamp files, and subsequently the provided routine to simulate m 0 -level single photon emitters. Supporting information -manual to the Python code Processing toolbox -overview Figure 8: Flow chart of the processing toolbox described in the main text. Figure 8 shows the different parts of the data analysis tools provided in the toolbox, and describes a workflow to perform a full analysis. The diagram shows main functions as dark blue ellipses, input and output files as green boxes, with blue frames indicating groupings or related tasks the code performs. Supporting information -manual to the Python code The starting point for the code is a provided set of three lists of timestamps, which represent three channels, i.e., two photon counting channels, and a pulsed laser reference record. These timestamps are provided as sorted lists of 64-bit integers through "parquet" files. To convert integer timestamps to actual times, the user can specify a discretisation unit, which for experiments would generally be the intrinsic binsize of the TCSPC card used. The data is expected to be in "reverse start-stop" format as usual for TCSPC experiment, meaning that the pulsed laser reference trace contains time stamps for the laser pulses immediately after each photon event. Simulated data is simulated with a user specified intrinsic binsize and assumed pulsed excitation repetition rate. Supporting information -manual to the Python code The processing code has the following functionality. First, the data is segmented into intervals using changepoint analysis. This returns the jumptimes at which the emitter at hand jumps in intensity, and between which the dot is constant in intensity, within the CPA threshold. Next, for each segment, the detector and photon channels are time correlated (block "segmented correlations") to obtain fluorescence decay trace photon counting histograms per segment, to which a decay rate can be fitted with the maximum likelyhood method (MLE). These processes lead to a set of intermediate, ASCII-formatted files that contain the segmented jumptimes, intensities and decay rates. The reminder of the routines are found on the right hand side of the diagram. The top block "timestamp related functions" acts not on the segments, but on the timestamp list as a whole. They convert the timestamps list into time-correlations between detectors, and detector and laser, across the whole dataset, to provide a decay trace, g (2)(τ ) and long-term autocorrelation trace. The remainder of the blocks post-processes the segmented data. This includes on one hand grouping according to Bayesian analysis, and on the other hand plotting of the segmented data as time traces, FDID diagrams, and switching time histograms. Supporting information -manual to the Python code The philosophy of the code is that it can interchangeably run on experimental and simulated data simply by setting a Boolean switch in the code. The Boolean switch redirects the routine to take information from the preamble XXX.py files, where XXX points to experimental resp. simulated data. The preamble files contain the input and output data file paths and required metadata for processing. The input time stamps are taken from the folders labelled Data XXX, while the output is saved in the folder Output XXX with Each function can be run independently provided that any required intermediate files have already been generated. Supporting information -manual to the Python code To demonstrate a complete run through the entire workflow, we provide the script En-tireWorkflowScript.py. This script is just a sequence of independent function calls, with no passing of variables between functions. We note that to work with experimental example, the user needs only run or adapt EntireWorkflowScript.py. For exploring a large variety of simulated problems, it suffices to run the simulation routine (see below), and work with EntireWorkflowScript.py, largely without need to adapt preamble simulated.py. Supporting information -manual to the Python code Under the hood, the actual dataprocessing algorithms are contained in the four basic routines: Supporting information -manual to the Python code 1. CPA functions.py -segments the timestamp file using changepoint analysis 2. grouping functions.py -clusters lists of jumptimes and counts per segment into the most likely set of levels, according to Bayesian information criterion. Supporting information -manual to the Python code 3. correlate jit.py -contains the timestamp-based channel auto and cross-correlation algorithm reported by Wahl et al. 49 It provides decay trace histograms when correlating photon and laser channel, used for both segments ("segmented correlations") and aggregate data record ("unsegmented correlation"). It provides g (2) (τ ), when giving detector channels A and B as task to correlate, and it provides on a logarithmically coarsened time axis the normalized intensity autocorrelation to perform the intermittency analysis proposed by Houel et al 31 The remainder of the routines are for file input-output, bookkeeping and plotting, relying on the core routines listed above for the actual work. Segmenting the data Module name: CPA wrapper.py Input files: timestamps chX bin.parquet Output files: metadata dataset.txt, segmentbounds.txt Segmenting the data In this script, the data -experimental or generated by the dot-simulation routine -is segmented according to the user's instructions. The script loads the data from three parquet files, which are binary data files containing all the photon event timestamps on the three channels: the two measurement channels from the Hanbury-Brown Twiss setup of photodetectors, and the reference channel. This is a ubiquitous setup for single-photon detection, but we note that, in the case of a different number of detectors, the code can be adapted to accommodate for this, as in most scripts (except for g(2)(τ )), the events from the two photodetectors are merged into a single list. Segmenting the data The script initially retrieves a number of properties about the data, such as the number of counts in all channels, and the length of the time record (timing of the last events), which together with the timing bin width (specified in preamble.py) are written to a metadata file. This file also includes a retrieve time offset between channels A, B and R estimated from the data. That is, an event on a detector and the corresponding reference event will be offset by (1) the time it takes for the emitter to decay, and (2) the path difference between detectors and reference diode. The quantities Tau0A bin, Tau0B bin refer to the latter. In simulated data there is no such time offset, but in experimental data there are typically optical and electronic (cable length) path differences which one needs to correct for before splicing two detector channels into a single fluorescence decay trace. Segmenting the data The script next calls cpa functions.py, which takes the combined photon timestamps from channel A and B as input, and returns the timestamps at which a changepoint occurs accord-ing to Bayesian inference. This routine takes the basic formalism to find a single changepoint in a dataset that has photon timestamps distributed according to exponential waiting time statistics, as specified by Watkins, 26 Ensign, 40 and in the main text. This formalism is applied iteratively to the resulting segments, subdividing them until no more changepoints are found. The routines returns both the timestamps (jump times t 0 , t 1 , t 2 , ...) and the associated photon event indices, which is equivalent to the cumulative number of counts up to the time of the jump. The single-changepoint detection routine requires a level of 'skepticism' to accept or reject changepoints, set in the preamble python file. For an explanation on the which values are appropriate, we point the reader to 26 and. 40 Lifetimes per segment Module name: segmented crosscorrs.py Input files: timestamps chX bin.parquet,segmentbounds.txt Output files: corr seg.txt, segment fit data.csv This script again imports the photon events from the parquet files, as well as the segment bounds (jumptimes) calculated and exported by CPA wrapper . Looping through the segments, the events on either detector are correlated with the events in the reference channels using correlate jit, following the method of. 49 The correlations are calculated over a time range equal to the (assumed) repetition rate of the excitation laser. This gives two 2 × Q − 1 × q matrix, with Q the number of found CPA jumps (including time series start and stop) and q the ratio of τ L the time between excitation pulses over the timing card resolution. Thus each each of the 2(Q − 1) (factor 2 for the two detectors) rows represents a fluorescence decay histogram for a segment. Since the correlation calculations can be quite lengthy, they are saved to corr seg.txt, for loading as needed. In addition, we speed up these calculations significantly by making use of Numba, which is a so-called just-in-time (JIT) compiler. This allows a specified section of Python code to be accelerated by just in time compilation. For these segmented correlations, this gives a speedup of between one and two orders of magnitude. This JIT compiler is applied for all correlations calculated, others including the g 2 (τ ), the full decay trace, and the coarsened autocorrelation. Lifetimes per segment Following the interpretation-agnostic conversion from timestamps to decay histograms per segment, an exponential decay (by default single exponential -several other dependencies are preprogrammed and could be chosen by the user) is fitted to each segment. This is done using the maximum likelihood estimator (MLE) relevant to Poisson statistics, explained by Bajzer et al. 50 through the routine fitexp MLE. Before fitting, the data is prepped. This includes timeshifting the photon channels such that the peak of the decay histograms lands at τ = 0 (each might have a different shift, determined by the routine as Tau0A bin and Tau0B bin), reversing the time axis (exponential decay tail towards positive time, undoing reverse start stop) clipping out negative times (detector rise), and includes an option for clipping out user-specified data intervals. This is useful for experimental data, where electronic ringing in DPC/TCSPC chips sometimes causes artefacts that should not be fitted. Note that excluding this range from the fit is not the same as setting the counts for this range to zero, instead removing them entirely. Lifetimes per segment After the data prepping per detector channel, the detector channels are spliced, so that decay rates are determined from the full photon record (sum of both detectors). Importantly for MLE-fitting of Poisson distributed data in which the probability distribution is linked to absolute count values, the data is neither scaled, nor background substracted. By fitting a single exponential A exp(−iγt) + b, three values and their respective errors are obtained. The routine exports A, γ, the error in γ, and b. It should be noted that in the subsequent processing routines only γ and δγ are used, as the best estimate for the count rate per segment simply follows from the number of counts in a segment N q divided by the segment duration T q (error follows from the square root of the number of counts, divided by the segment duration). The fitted values are saved, and can be reloaded as a pandas dataframe in segment fit data.csv. The fit routine starts from an initial guess for parameter values that are estimated from the data itself. For insightful explanations of the maximum likelihood estimator, we refer the reader to. 50? Grouping, determining most likely levels Module names: grouping wrapper.py Input files: segmentbounds.txt Output files: grouping.txt This routine operates on the result of CPA wrapper, i.e., the file segmentbounds.txt produced by it. This consists of a list of jump times (t 1 , t 2 , ..) and (cumulative) counts per segment, which convert into segment durations T q = t q − t q−1 , counts per segment N q and per-segment count rates I q = N q /T q . Following the main text, the segments are clustered into a first guess for the actual Bayesian grouping analysis using a recursive hierarchical clustering algorithm that crawls through a data set of Q − 1 segments in Q − 1 steps, in each step grouping the segments with the nearest intensity together. We find that the final result of the Bayesian grouping analysis is not very dependent on this initial guess, which allows for a shortcut. For this reason we us a faster version of the original hierarchical clustering proposed by 26 for large data sets, which consists of hierarchically grouping small blocks of 300 subsequent segments to 30 levels each, concatenating those, and then grouping. The result is groupings of the data in a range of n G levels (in our analysis we didn't go beyond (n G ) = 20). Grouping, determining most likely levels After this initial guess, the segment allocation to intensity levels, and the level-values are optimized following Section 2.3.2 of. 26 Here, the segments, divided into exactly n G groups by the initial hierarchical clustering, are iteratively swapped out, until the most likely grouping on the assumption of exactly n G levels is achieved, with the best estimate for the intensity levels. Thus for each hypothetical distribution in n G ∈ mingroups, ..., maxgroups levels, the most likely assignment of each segment to an intensity level I 1 , ...I n G is determined. This gives a "trajectory" of the emitter through the different levels, and is the which-level information for each segment, for each of the tested n G . Finally, to determine which value of n G most likely describes the data, the Bayesian Information Criterion (BIC) is calculated as function of n G . This gives the likelihood of a given n G to be the true, underlying set of levels. For simulated m 0 -level dots indeed, the BIC peaks at n G = m 0 Grouping, determining most likely levels The grouping routine returns its result as plots and ASCII data in grouping.txt. This data folder contains three sets of information. The first is a list of the values of the Bayesian Information Criterion, discussed in the main text and shown in Fig. 4a. The second is a square matrix, where the values b n G ,m describe the fraction of time spent in state m, given that the grouping algoithm had n G intensity levels available to it. This yields figures such as Fig.4b in the main text. Lastly, the file contains a 2D matrix that describes the "trajectory" of the emitter through the available levels, given that n G levels are available to it. There is no figure of this in the main text, though Fig. 1D. provides a sketch. Grouping, determining most likely levels Postprocessing segmented data, plot routines Time trace Grouping, determining most likely levels Module names: plot timetrace.py Input files: timestamps chX bin.parquet, segmentbounds.txt, segment fit data.csv Output files: none Grouping, determining most likely levels This script functions purely as a visualization of the behavior of the emitter as a function of time. For plotting purposes the photon events are binned in equidistant time bins to obtain an intensity trace in time, which is plotted alongside the intensities and decay rates retrieved by CPA (i.e., without any binning). Additionally, a histogram of the intensity levels in the time trace is plotted. This is an unweighted histogram, where all CPA-determined segments have equal weight, independent of their duration. The routine also plots a time trace of the fitted decay rates with its corresponding histogram besides it. For plotting purposes, the routine attempts to guess reasonable plot axes from the data. Switching time statistics Module names: switchingtimehistogram.py Input files: segmentbounds.txt Output files: switchinghist.txt Switching time statistics In this section of the code, the time durations T q of all found CPA segments are taken into a histogram with logarithmic bin, implementing apropriate normalization to convert the segment durations to a segment duration probability distribution function distribution. Next, the routine fits a power law, as typically observed for many single emitters follow in their on/off times. Because CPA is more likely to miss switching events if they are very short (segment with < 50 to 100 photons), the found histogram will slope off from the initial power law at short switching times. The routine will therefore fit a power law to the part of the curve at larger switching times than a chosen threshold value. It uses the minimize module from scipy.optimize to do a least-squares fit to the data, reporting as output the fitted power law exponent and a plot to assess the quality of fit. FDID and FLID diagrams Module names: FDID wrapper.py Input files: segmentbounds.txt, segment fit data.csv Output files: FDID.txt, FLID.txt FDID and FLID diagrams In this script, the segment intensities and segement-resolved decay rates are compiled into fluorescence decay rate intensity diagrams (FDIDs) and/or fluorescence lifetime intensity diagrams (FLIDs). Either of these diagrams can be made by setting a boolean in EntireWorkflowScript.py. For these processes, the I q , γ q values of all segments exported into segment fit data.csv from CPA wrapper.py are used to build the 2D histograms. The process is nearly identical for either diagram, after decay rates and the error thereof are converted into lifetimes, and both options are contained in the same routine. For the FDID and/or FLID, instead of simply compiling a histogram of square bins, each segment contributes a smooth 2D Gaussian, the widths of which are determined by the error on the segment decay rate and the estimated uncertainty in the count rate for that segment, derived from the fact that counts per segment are Poisson distributed. The weight of each Gaussian is defined as its integral. As explained in the main text, three different definitions of weight per segment can be used: (1) all CPA segments have the same weight, (2) the weight of a segment is determined by the number of photon events in it, (3) the segment weight is determined by the time duration of the segment. When applying weighting, it is the volume under each 2D Gaussian that is weighted. A single routine FDID functions constructs the FDIDs and FLIDs as sum of Gaussians, with the desired choice of weight passed as argument from the routine FDID wrapper that handles file input, and plotting. For plotting purposes, the wrapper routine attempts to guess reasonable plot axes from the data. The resulting FDIDs and FLIDs are output as ASCII files and plots. Output: FDID and FLID diagrams • FDID prio none and/or FLID prio none, 2D array, the FDID/FLID where all CPA segments have the same weight FDID and FLID diagrams • FDID prio cts and/or FLID prio cts, 2D array, the FDID/FLID where the CPA segments are weighted by the amount of counts This script converts the segmentation results from CPA wrapper into correlative plots that highlight if there are memory effects and correlations between segment observables. The routine reads in segment fit data.csv, i.e., sequencies of intensities I q , the fitted decay rates γ q , and segment durations T q . Due to the large range of segment durations, plots are based on log 10 T q . The generated plots report on: FDID and FLID diagrams 1. Aging: Time trace of I, γ and log 10 T q versus 'wall clock time'. In these figures, the aging of an emitter can be observed, e.g. if the dot becomes dimmer over time, or segment lengths grow or shrink. FDID and FLID diagrams 2. Concurrent observable correlations A set of 2D histograms of the log 10 T q versus (1) intensity I q and (2) the fitted decay rate γ q . This can be used to detect if there are correlations between these quantities. These diagrams are anaologous to FDID or FLID diagrams, which are just 2D histograms of I q versus γ q . FDID and FLID diagrams 3. Memory A set of 2 × 3 2D histograms, which plot conditional probabilities of x n against x n−1 and x n 2 , with x ∈ I, γ, log 10 T q . These are 2D histograms that examine the same observable along both their axes, but at subsequent steps in the segment history. For instance, plotting γ n against γ n−1 highlights if subsequent decay rates are uncorrelated, or correlated. FDID and FLID diagrams 4. Segment sequence autocorrelations of the lists I q , γ q and log 10 T q . Note that autocorrelating a list such as I q is not equivalent to calculating the intensity autocorrelation, i.e., autocorrelating I(t) as provided by Houel autocorr.py, since the segment intensity list I q contains intensity levels of segments with highly unequal duration, whereas the autocorrelation of I(t) depends on the switching dynamics in time. The segment sequence autocorrelation brings out the number of switching cycles over which the correlated observable shows a memory. Unsegmented data analysis Decay trace and fit, entire dataset Unsegmented data analysis Module names: unsegmented crosscorrs.py Input files: timestamps chX bin.parquet Output files: corr unseg.txt Unsegmented data analysis The entire data set is processed by correlate jit to obtain the correlation between detector channel and reference channel, leading to two decay traces (for detector A, and B). As in the case of the segmented decay trace determination routine, this data corrected by zeroeing the time axis, reversing the start-stop reversed time axis and removing the detector artefacts (risetime, electronic ringing). The two detector channels are then merged to obtain a fluorescence decay histogram. To this, an n-exponential curve can be fitted. The same Poisson-MLE is used as for the unsegmented data. Using the Minimize function from the Scipy Optimize module, we minimize our merit function such that a n-exponential decay Unsegmented data analysis is fitted to the calculated decay trace. Here, A j and γ j are the proportionality constants and the decay rates of the decay j, respectively, and b describes constant background noise. Unsegmented data analysis When fitting, we optimize for A j , γ j , B. How the fit merit function is calculated from the data and the fit function is discussed in the main text. Unsegmented data analysis Autocorrelation g (2) (τ ) Unsegmented data analysis Module names: g2 tau.py Input files: timestamps chX bin.parquet Output files: g2.txt This function reads the photon detection time stamps from parquet file, and then calculates the unnormalized intensity autocorrelation g (2) (τ ) by correlating the two detector channels following the method outlined in 49 to obtain g (2) (τ ). For data taken in a Hanbury-Brown Twiss setup, this should reveal antibunching, as is the case for the example experimental data set. The simulated data generated by running the provided routine also antibunches. It should be noted that the routine does not correct for relative constant offsets in channel timings due to, e.g., differing electronic delays (cable lengths), which, if present, expresses as a small shift of the the g (2) (τ ) along the the time-axis. Long-time intensity correlations Module name: Houel autocorr.py Input files: timestamps chX bin.parquet Output files: Houel autocorr.txt Houel et al. 31 proposed that intensity autocorrelations on the time scales of milliseconds to seconds express an unbiased assessment of intermittency characteristics, relating at least for binary on/off behaviors to power law exponents of dwell times. While Houel et al. operated on intrinsically timebinned data (camera frames), we provide a routine that operates directly on timestamps. The routine Houel autocorr.py reads in timestamps for two detector channels from Parquet files, splices the two channels in a single array of time stamps, and then calls correlate jit to autocorrelate the timestamp array. In view of the large time span over which the correlation is requested compared to the time-discretization intrinsic to the data (second versus 0.1 ns), a standard correlation as used for g (2) (τ ) is prohibitively slow. Therefore correlate jit provides a version of the timestamp correlation algorithm with logarithmically increasing steps in τ through a data coarsening approach as outlined in. 49 As opposed to the unnormalized g(2) for antibunching, now the output that we refer to as ACF is normalized. To ACF-1 a powerlaw with exponential roll off Long-time intensity correlations is fitted where we use the minimize function of Scipy's Optimize module and a least-squares fit. According to Houel et al. 31 the fit parameters trace back to power law exponents in the case of binary (on/off) intermittency. Auxiliary routines The role of the remaining routines in the processing toolbox is • acc functions.py contains shorthand for auxiliary mathematical functions, and 2D plot color map • EntireWorkflowScript.py example script executing full sequence of processing steps. Booleans in the file set the requested tasks (e.g., simulated or experimental data), but otherwise no data is passed from function to function. The only dependency is through the intermediate data files Auxiliary routines • loaddata functions.py contains file input output commands for reading and writing the various files in the appropriate formats and directories Auxiliary routines • pypreamble measured.py contains the file paths to the example experimental data, and required output data, as well as metadata required for processing. These include the TCSPC discretization bin size of the experiment (0.165 ns, Becker and Hickl DPC-230) and the laser repetition rate (10 MHz) in the experiment that generated the data. Auxiliary routines • pypreamble simulated.py contains the file paths to simulated emitter data, and required output data, as well as metadata required for processing. It should be noted that parameters required for processing, i.e. the assumed time bin discretization unit and laser repetition rate need to be specified in the file, and need to be consistent with how the data was generated. They are not automatically passed from the simulation routine to maximize the direct exchangeability of experimental and simulated data for testing the toolbox. Binning instead of using CPA In the sections above, we have discussed the analysis following segmentation of the data using CPA. However, the same analysis can be applied following segmentation using equidistant bins. If the user is interesting in applying equidistant binning, this can be done by flipping the Boolean CPA insteadof binned in the workflow module. The output from this segmentation and analysis will be saved in separate folders, to avoid overwriting CPA-sectioned data. The only script that will not work when equidistant binning is applied, is of course switchingtimehistogram, as its function starts off with building a histogram of the duration of the segments. Simulate N-level emitters Module name: simulate qdot.py Output files: timestamps chX bin.parquet, nominalsegmentation.csv Simulate N-level emitters We provide a routine to generate time-tagged data of an m 0 -level single emitter for Monte Carlo simulations testing the toolbox, or for testing how assumed photophysics would appear in experiments. This routine is provided in a separate folder from, and is in terms of code independent from, the processing toolbox. It produces timestamps in parquet file format that, together with an appropriately specified preamble simulated.py file can be processed in exactly the same manner as the example experiment data set . Simulate N-level emitters In this section, we will describe the method used to simulate time-tagged data of an m 0 -level single emitter with MC simulations. The entire workflow of generating a dot can be executed by running entire simulate qot workflow.py. This script generates photon time stamps, and also creates plots and a reference datafile to examine the assumed and simulated intermittency behavior. Simulate N-level emitters The simulation of the emitter behavior happens in a number of steps, as follows: Drawing the segmentation information First we randomly draw the random segmentation sequence according to which the photon time stamps will be subsequently randomly drawn, using the following procedure: Drawing the segmentation information 1. The user specifies the number of levels nlevels= m 0 , and the associated nominal intensity levels, decay rates, and dwell-time power law exponents through the preamble file. 2. A random list is created with indices that label the order in which the intensity levels are visited. For each entry in the list, the index is drawn independently and all levels have equal likelihood. If an entry is a direct repeat of its predecessor, it is removed from the list. The segment lengths are drawn using the following formula ? 2. where a is the short time cut off Tshortest ns, b is the long time cut offTlongest ns, and β is 1 − α, with alpha the specified power law exponent for the given level. 2. x is a random number generated with numpy's random.rand module, and has units of dtau ns. Drawing photon events The next step is to draw photon timestamps according to the randomly drawn segmentation sequence. The segmentation sequence specifies a list of jump times t 1 , t 2 , ..., t Q and a concomitant sequence of levels visited, which specifies the nominal count rate, and decay. We draw the photon events in a two step process: Drawing photon events 1. Since we envision simulating a single emitter in a pulsed experiment, every laser repetition cycle there can be at most one photon resulting from an excitation event. That means that for a given nominal count rate there is a known probability p that one photon is generated. We thus draw photon time stamps with a resolution equal to the laser repetition time τ L by separating a segment of length T q in T q /τ L bins, drawing for each bin a random uniformly distributed number between 0 and 1, and conclude that a given cycle corresponds to a photon if the corresponding drawn random number exceeds p. In the provided example, τ L = 100 ns, which gives the granularity with which the time stamps are defined at this step. The probability of a photon event is given by p = I q × τ L . It should be noted that drawing rare events according to uniform distribution results in Poisson distributed count rates upon binning. Programmatically, only the list of timestamps labelling laser cycles with a resulting emitted photon are kept, and stored in list timestamps chR bin. This ultimately is the reference channel for the simulated two-detector TCSPC measurement. Drawing photon events 2. Next we fine-grain the photon time stamps, to account for the fluorescent decay trace. For each timestamp in the reference channel, a photon arrival time relative to the laser pulse is drawn through numpy's random.exponential module, with the appropriate decay rate from g lst for the relevant segment. Drawing photon events 3. from a memory management viewpoint, step 1 is prohibitive if applied to the entire desired time trace (typically 10 11 laser cycles, for only 10 7 photon events), so we apply it segment by segment. To avoid the slow python append function, the timestamps are stored in a preallocated, overdimensioned container array, which is clipped to size after generating all the time stamps. Since we provide a simulation toolbox to mimic TCSPCS experiments, all times are expressed as integer multiples of an assumed card binsize dtau ns. This allows us to express all time quantities in int64 format. Drawing photon events 4. uncorrelated dark noise for two detector channels is drawn according to step 1, with in step 2 a uniform random arrival time distribution. Distributing events over channels The outcome of the previous step is a set of time stamps timestamps chR bin corresponding to laser pulses with a concomitant detection, and a list of delay times relative to the laser pulses. These are translated into antibunching detector channels as follows: Distributing events over channels 1. We construct photon arrival time stamps in reverse start stop, by taking timestamps chR bin adding the delay times, and subtracting the duration of exactly one laser period. This leads to a list of photon time stamps timestamps bin. Distributing events over channels 2. For each event in timestamps bin we randomly assign it to detector channel A or detector channel B, with equal and independently drawn probability. Distributing events over channels 3. Finally we splice the generated uncorrelated detector noise events noiseclicks chX with X ∈ A, B into the data stream. The concomitant laser pulse arrival times was previously sent into timestamps chR bin. Distributing events over channels These operations ensure that the two simulated detector channels will show antibunching in g (2) (τ ), with a visibility limited by the signal to background count rate. The background noise photon events are only added now, as adding them earlier would cause the noise to antibunch as well. Input and output files The simulation module requires input parameters, which are specified through the module preamble for simulation.py. The input parameters include parameters of the simulated emitter (number of levels, concomitant nominal count rates, decay rates, and power law exponents) and of the simulated measurement (laser repetition time, time discretization bin size, background count rate, and total wall clock length of the measurement record). Input and output files It is important to note that most of the variables are independent of the variables used for processing the data, except the variables that pertain to the properties of the "measurement" itself. These are what in a measurement corresponds to the timing resolution of the counter card and the repetition rate of the excitation, called dtau ns and minitimebin ns respectively. When analyzing simulated data, the values of these two variables must be the same as in data generation. Input and output files As output three lists of timestamps, with timestamps as 64 bit integers in units of the timing resolution dtau ns, representing two detectors in a Hanbury-Brown Twiss configuration, and a laser pulse reference channel for both. These are saved in a compact binary format as parquet files. As a service to the user, the simulation writes out the datafile nominalsegmentation.csv with the jump times, and the concomitant sequence of nominal segment count rates and decay rates according to which the data was drawn. This can e.g. be used to check the accuracy of the CPA, grouping, and lifetime fitting routines. Example experimental data We provide select example data sets with the toolbox that were obtained on a CsPbBr 3 quantum dots, as reported in Ref. 43 (dots 2, 4, 6, 8, 16, with reference to supplement of that paper). While the full experimental protocol is reported in that paper, here we report the information pertinent for interpreting the time tagged data. The data was obtained using pulsed excitation at 10 MHz repetition rate (LDH-P-C-450B pulsed laser diode, PicoQuant) at 10 MHz, with confocal excitation and collection through an oil objective (Nikon Plan APO VC, NA=1.4). Detection was on two fiber-coupled avalanche photodiodes (APDs) (SPCM-AQRH-14, Excelitas) in a Hanbury-Brown & Twiss configuration. The APDS were coupled to a photon correlator (Becker & Hickl DPC-230). It uses a 0.165 nm temporal binsize, and simultaneously records absolute photon arrival times from both APDs, and the arrival times of laserpulses subsequent to photon detection on any detector. We note that this means our decay traces are taken in reverse start-stop configuration, as is standard in TCSPC to reduce data rates. A small time interval centered at around 30 ns is subject to an electronic artefact which we attribute to a ringing in the DPC-230 TDS timing chips. This interval is included in the supplied data -the toolbox is set up to exclude it from the analysis. Our measurements are taken over 120 seconds of acquisition time. The timetagged data was converted from the Becker and Hickl dataformat using C# code that uses the Becker and Hickl SPCM DLL toolkit. We note that the data of any of the TCPSC/timetagging equipment vendors can be analyzed by our toolbox, provided it is converted from proprietary format to timetagged channel data, saving the timetag lists expressed in units of the card bin size as ordered 64-bit integer arrays, with a single parquet file per channel. Dependencies The code is posted on GitHub https://github.com/AMOLFResonantNanophotonics/CPA/. This code has been developed in Python 3. 8 Archived versions The first version of the code, and the example data sets are archived via DOI:10.5281/ zenodo.4557226

섹션 본문 116문단 · 76,881자

(제목 없음)

1We report on a Python-toolbox for unbiased statistical analysis of fluorescence intermittency properties of single emitters. Intermittency, i.e., step-wise temporal variations in the instantaneous emission intensity and fluorescence decay rate properties are common to organic fluorophores, II-VI quantum dots and perovskite quantum dots alike.Unbiased statistical analysis of intermittency switching time distributions, involved levels and lifetimes is important to avoid interpretation artefacts. This work provides an implementation of Bayesian changepoint analysis and level clustering applicable to time-tagged single-photon detection data of single emitters that can be applied to real experimental data and as tool to verify the ramifications of hypothesized mechanistic intermittency models. We provide a detailed Monte Carlo analysis to illustrate these statistics tools, and to benchmark the extent to which conclusions can be drawn on the 1 arXiv:2102.11044v3 [physics.comp-ph] 5 May 2021 photophysics of highly complex systems, such as perovskite quantum dots that switch between a plethora of states instead of just two.

Introduction

2Since the seminal first observation of single molecule emitters in fluorescence microscopy three decades ago, 1 single quantum emitter photophysics has taken center stage in a large body of research. On one hand, single quantum emitters as single photon sources 2 are held to be an essential part of quantum communication networks and are deemed essential for building optically addressed and cavity-QED based quantum computing nodes. 3 This has particularly spurred research in III-V semiconductor quantum dots, 4,5 color centers in diamond, silicon carbide and 2D materials, [6][7][8] and organic molecules at low temperature. 9 On the other hand, classical applications of ensembles of emitters for displays, lighting, lasers and as microscopy-tags drive the continuous development of new types of emitters, such as II-VI self-assembled quantum dots 20 years ago, [10][11][12] and inorganic perovskite quantum dots just recently. [13][14][15][16][17][18][19][20] For all these systems, understanding the photophysics on the single emitter level is instrumental, whether the intended use is at the single or ensemble level.

3A common challenge for almost all types of emitters is that they exhibit intermittency, also known as blinking. 21,22 Under constant pumping emitters switch, seemingly at random, between brighter and dimmer states, often corresponding with higher and low quantum yield (QY), and different fluorescence decay rates. Frequently the switching behavior also shows peculiar, power-law distributed, random distributions of durations of events. Determining the mechanism through which emitters blink, i.e., the origin of the involved states, the power-law distribution of residence times, and the cause of switching, have been the topic of a large number of studies particularly for II-VI quantum dots as recently reviewed by Efros and Nesbitt. 23 Recent studies on inorganic perovskite quantum dots uncover intermittency behavior that does not fit common models for intermittency in their II-VI counterparts. [14][15][16][17][18][19][20] time stamps CPA Grouping Figure 1: A schematic overview of the working of the toolbox. (A) An illustration of the two methods available to obtain TCSPC data, either by photolumiescence TCSPC measurements of a single emitter (top panel) or through simulation of a single emitter (bottom panel). The latter is provided in the toolbox. Both will result in a stream of timestamps that can then be further analyzed by the toolkit. The simulation part of the toolbox simulates dots of m 0 levels, with associated count rates and fluorescence decay rates I m and γ m , with the dot visiting levels in random order, and with residence times for each segment chosen drawn according to specified power law exponents α m . The output simulated data consists of time stamped photon arrivals over a total time span T , where for each photon k = 1 . . ., a time stamp s k is recorded. These time stamps are randomly distributed over two detector channels S A , S B . The delays of each of the photon time stamps relative to the time stamp in the third channel S R , representing the periodic pump laser pulse train, is chosen in accordance with the set emitter decay rate. (B) Starting out with this stream of photon events, using CPA (C), the changepoints are found, and with these, the instantaneous intensities. (D) Subsequently, these events are grouped in order to find the most likely underlying intensity levels between the behavior. Following this, a number of analyses can be done, such as (E) ascertaining whether the time between switching events is powerlaw distributed, (F) the visible separation of states in FDID/FLID (fluorescent decay rate intensity diagrams, resp. fluorescent lifetime intensity diagrams), and (G) the presence of memory in the switching behavior. Here we show an example of a simulated, 4 level emitter, with simulation parameters chosen for clarity of illustration.

4In order to quantify intermittent behavior, the simplest and most commonly employed method is to subdivide a measurement stream of individual photon-arrival times into short bins of a few ms, to calculate the intensity (in counts/second) of each bin. Every bin can then be assigned to a state (on, off or grey) according to its brightness so that on/off times as well as intensity levels can be defined and analyzed. 21 For pulsed laser excitation, also quasi-instantaneous fluorescence decay rates can be obtained. 24,25 However, it is well known that this method of binning time streams and histogramming binned intensities causes detrimental artefacts. 21,[26][27][28][29][30][31][32] Retrieved parameters of the quantum dot behavior often exhibit a dependency on the choice of the bin width, which affect estimates of switching time distributions and power laws,and also the objective assignment of intensities to intrinsic levels.

5Narrower bin widths in principle allow better resolution, but run into shot noise limits, while conversely choosing larger bins suppresses noise, but will render the analysis blind to fast events. To overcome these issues, Watkins and Yang 26 proposed changepoint analysis (CPA) as a Bayesian statistics approach for the unbiased determination of switching times that is optimal, i.e., gives the best performance given the constraints of shot noise in the data. Changepoint analysis and clustering is one example of Bayesian inference methods to determine the transitions and underlying levels in single photon trajectories. In the domain of high-throughput single-molecule analysis 33 many methods to process single photon trajectories have appeared, that one can classify as supervised learning methods with a priori model assumptions on one hand, and unsupervised approaches on the other hand. Prominent are socalled hidden Markov Model (HMM) methods 34 that view photon data streams as experimentally measured output of transitions between hidden transition states. Bayesian inference can then estimate parameters such as transition probabilities if one a priori postulates the number of levels and the allowed transitions. As this underlying model is a priori often not known, one can apply HMM with different possible models, and rank them according to probabilistic criteria, such as the Bayesian Information Criterion. Also, the requirement for a priori known models is relaxed in socalled aggregated Markov models, 35 and non-Markov memory kernel models. 36 Juxtaposed to such supervised analysis methods are unsupervised approaches. Such methods apply changepoint analysis to partition data into time segments between jumps, and subsequent clustering of intensity levels. The CPA method pioneered by Watkins and Yang is essentially such a combination of changepoint detection and hierarchical agglomerative clustering, using the Bayesian Information Criterion to determine the best clustering of measured intensities in distinct levels (states) with as sole assumption that intensity in each segment of time wherein the emitter is in a given level, the counts are Poisson distributed. 26,29 A main drawback is that particularly the clustering is slow. We refer to Ref. 37 for recent developments in machine learning to mitigate this problem. A main advantage of CPA is that no underlying model is required, and that the data is segmented and clustered to the level that the data allows, given that the data is Poisson distributed in intensity, and given a required confidence level stipulated by the user.

6Variations on CP for other types of noise, such as Gaussian noise, have also appeared. 38,39 Despite the well-documented superior performance over binning of photon counting data, in the domain of single photon counting data from quantum dots only very few groups have adopted these methods. 17,26,28,29,32,40,41 In this paper, we provide, benchmark, and document a Python toolbox for changepoint analysis, state clustering, and analysis of fluorescence-intensity-decay rate correlations that is posted on GitHub. 42 A main motivation lies in the emergence of new quantum emitter systems with complex photophysics. While II-VI quantum dots for which CPA was orginally developed, are generally understood to switch between just two or three states, the problem of accurate analysis of intermittency is gaining in prominence with the advent of novel emitters, such as perovskite quantum dots which appear to switch not between just two, but instead a multitude of states. [14][15][16][17][18][19][20] There is hence a large need for a toolbox that provides unbiased, model-free analysis of photon counting data, for which reason we provide a CPA implementation and benchmark it for complex multilevel emitters. Our toolbox is both applicable to real quantum dot data, and valuable as a testbed for both testing models and analysis techniques on synthetic, i.e., numerically generated data. Indeed, the code toolbox we supply includes code to generate numerically random photon time arrival data streams for 'synthetic' quantum dots that jump between an arbitrary set of intensity levels and decay rates, with jump time statistics and photon budgets that can be set by the user. As results we provide benchmarks on the performance of CPA for detecting change points in function of the number of intensity levels and total photon budget, and we explore the limits to the number of distinct states that the clustering analysis can reliably separate. Moreover, the toolbox allows to us test the accuracy of jump time statistics, such as power law statistics, for such multilevel dots. Finally, the test suite also allows to benchmark the accuracy of fluorescence decay model fitting with maximum likelihood estimation, and we discuss the construction of fluorescence-intensity-decay rate correlations from CPA-partitioned data. The applicability of the toolbox to experimental data is illustrated by supplied data sets, which correspond to a related paper in this journal. 43 We note that some other approaches such as HMM methods may be more suited for processes where more knowledge on the underlying physical processes is available. In contrast our toolbox is ideal for cases in which one wants to make no a priori assumption on the physical mechanism behind intermittency. Furthermore, the CPA method in the toolbox operates on the finest level of information available in photon counting, i.e.. the distribution of individual photon arrival times, as opposed to methods that are optimized to work on camera frame data. 33 This paper is structured as follows. In the Methods section we summarize the Bayesian statistics tools we implemented to analyze all aspects of our data.

7Next, we benchmark the performance of changepoint analysis to pinpoint intensity jumps, and of level clustering to identify the number of levels between which a dot switches on the basis of Monte Carlo simulations. Next we present considerations on the dependence of on-off time distributions, decay rate fit and so-called 'fluorescence decay-rate versus intensity diagrams'(FDIDs) on count rates.

Methods

8In this section we present all the methods implemented in our Python toolbox, as well as the methods for benchmarking them. Benchmark results are presented in the results section.

9We refer to the supporting information for a manual to the code and the code itself.

Changepoint analysis

10First, we summarize changepoint analysis (or CPA), a Bayesian statistics method for the unbiased determination of jumps or 'changepoints' in time traces of discrete events. 17,26,28,29,32,39,41,[44][45][46][47][48] Bayesian statistics is a paradigm that reverses the usual standpoint of probability theory.

11Usual probability theory views a data set as a random draw from a probability distribution, given a hypothesis on the parameters of the underlying physical process. In this framework, one can calculate the likelihood of drawing the specific measured data set. Bayesian statistics, on the other hand, compares the likelihood of distinct hypotheses, given a measured data set and assumptions on the underlying measurement noise.

12We consider time-tagged single photon counting data consisting of an ordered list of measured photon arrival times s k , collected over a measurement time T . For a single emitter with no memory that emits at a count rate of N photons in a time T , the waiting times -i.e., the times between photon arrivals -are exponentially distributed with waiting time τ w = T /N . In order to determine whether there is a changepoint in some segment q, CPA compares the likelihood of two distinct hypotheses, (1) there is a jump in emission intensity (i.e. the average waiting time τ w jumping from some value to another) against (2) there is the same intensity throughout the measurement interval. When testing for a jump at photon detection event k at time s k in this trajectory q with time duration T q containing N q photon events, this leads to a log-likelihood ratio, or 'Bayes factor' 26,28,29

13where V k = s k /T q . Derivation of this log-likelihood ratio involves several steps. First, it incorporates the assumption that in between jumps, the waiting time between photons is exponentially distributed, on basis of which one can assess the likelihood of measuring the given data set for a given hypothesis on the exponential waiting time τ w . Second, it uses maximally non-informative priors for L k to compare the hypothesis of presence versus absence of a changepoint without further restrictive assumptions on the involved intensity levels.

14It should be noted that there are other ways to arrive at the same log-likelihood ratio test. One alternative starting point is a binary time series in which there is an underlying uniform and small probability distribution of photon detection per bin (e.g., imagining the time axis binned in by the timing card resolution (of order 0.1 ns for typical hardware)). 40 Such a uniform distribution would emerge as a direct consequence of exponential waiting time distributions. In this case one should start from a binomial distribution and ultimately arrives at the same formula after application of Stirling's formula. Another starting point is CPA applied to binned data with wider bins with multiple counts, i.e. to series of Poisson distributed intensities instead of discrete events. 26,29 However, the binning would introduce an undesirable time scale through the chosen bin width. Of these three methods, working with photon arrival times is the most data efficient approach and introduces no artificial partitioning whatsoever. We refer to Ref. 29 for a derivation of the log-likelihood ratio in all these three scenarios, which includes a precise description of the use of maximally noninformative priors.

15Following Watkins and Yang 26 and Ensign, 29 the most likely location of a changepoint, if any, is at the k that maximizes the Bayes factor L k . The hypothesis that this most likely changepoint is indeed a real event is accepted if L k exceeds a critical threshold value for L k or 'skepticism'. This value is chosen to balance false positives against missed events. A full data set is partitioned recursively, i.e., by recursively checking if data sets between two accepted changepoints themselves contain further changepoints. This results in a division of the data set into segments, each of which starts and ends at an accepted changepoint, and with the level of skepticism as stop criterion for the recursion. The resulting segmentation provides the most likely description of data as consisting of segments within which the intensity is constant, given the value chosen for the degree of 'skepticism', and given the amount of data collected. Since the algorithm works with the list of individual photon arrival times this segmentation entails no arbitrary partitioning. An accepted rule of thumb is that if the Bayes factor L k exceeds a 'skepticism' value of just between 1-3, the evidence for a changepoint is highly ambiguous, while values in the range 7-10 are deemed strong evidence

16The toolbox is supplied with a default value of skepticism of 8, set following the analysis of 26 and . 29 The reader is warned that for a given photophysics scenario (intensity levels, segment simultaneously and iteratively optimize the probability p mq for segment q to belong to the mth level, as well as an estimate of the intensities of these levels I m . In each iteration the intensities of all levels are estimated from the level assignment from p m,q . Following this, the probability distribution p mq is updated to redistribute the segments over the levels. In this calculation it is important to understand the type of noise statistics the data obeys. In the case of single-photon measurements, and for the purpose of this discussion, the intensities are Poisson distributed. The iteration is repeated until p mq converges (practically also capped by a maximum number of iterations). The final outcome is a most likely assignment of the measured segments into n G levels. Next for each value of nG one asseses the 'Bayesian information criterion' (BIC). This criterion is a measure for how good the description of the segmented intensity trace is with n G intensity levels given the assumption of Poisson counting statistics for each fixed intensity level. Beyond a mere 'goodness of fit' metric that would simply improve with improved number of parameters available to describe the data, this metric is penalized for the number of parameters to avoid overfitting. For Poisson distributed data the criterion is derived in 26 as

17where Q again is the number of change points detected, n G is the number of available levels.

18The term L EM is the log-likelihood function optimized in the expectation maximization step, i.e L EM = q n G m=1 p mq ln[p m P(I q ; I m )] with P ( x; λ) the Poisson probability function at mean λ, p m the probability of drawing level m. The second term in the BIC s the term penalizing the BIC for overfitting. The accepted best description of an emitter in n G -levels is taken to be at the value of n G where the BIC peaks.

19Intensity cross/autocorrelation and maximum likelihood lifetime fitting Many single photon counting experiments are set up with pulsed laser excitation for fluorescence decay rate measurements, and with multiple detectors to collect intensity autocorrelations (e.g., to verify antibunching in g (2) (τ ) for time intervals τ comparable to the fluorescence decay rate, and shorter than the commonly longer detector dead time). In a typical absolute-time tagging set up, this results in multiple data streams S A , S B , S R of time stamps corresponding to the detection events on each detector, and the concomitant laser pulses that created them, respectively. Our Python toolbox contains an implementation of the correlation algorithm of Wahl et al. 49 that operates on timestamp series, and returns, for any combination of channels S 1 , S 2 (1, 2 ∈ {A,B,R}), the cross correlation C(τ )∆τ , i.e., the number of events in the time series S 1 and the time series S 2 that coincided when shifted over τ , within a precision ∆τ .

20Cross-correlating detected photons and laser arrival times, taking ∆τ to be the binning precision of the counting electronics and the range of τ equal to the laser pulse repetition rate, returns a histogram of the delay times between photon detection events and laser pulses. To obtain g (2) (τ ) to investigate antibunching, streams of photon events from two detectors in a Hanbury-Brown Twiss set up are cross-correlated. ∆τ is taken to be the binning precision of the counting electronics and the sampled range of τ as an interval is taken symmetrically around τ = 0 and several times the laser pulse interval. Finally auto-or cross correlating detector streams over τ -ranges from nanoseconds to seconds, coarsening both τ and ∆τ to obtain equidistant sampling on a logarithmic time axis, results in long time intensity autocorrelations of use in intermittency analysis. 31 Our toolbox also provides this logarithmic time-step coarsening version of the correlation algorithm of Wahl et al. 49 Of particular interest for intermittent single emitters is the analysis of fluorescence decay rates in short segments of data as identified by changepoint analysis, that may be so short as to contain only 20 to 1000 photons. For each of the photon detection events in a single CPA segment, cross-correlation with the laser pulse train yields a histogram of the N q photons in segment q. In each of the bins (with width ∆τ ) the photon counts are expected to be Poisson distributed. Therefore the optimum fit procedure to extract decay rates employs the Maximum Likelihood Estimate procedure for Poisson distributed data, as described by Bajzer et al. 50 In brief, for a decay trace sampled at time points τ i relative to the laser excitation, with counts per bin D(τ i ), the merit function reads

21Assuming a chosen fit function F A (t) the parameter set A that minimizes this merit function provides the parameter values that most likely correspond to the data. The estimated errors in these parameters then follows from the diagonal elements of the inverse of the Hessian of M relative to the parameters A. Importantly, the fact that the Poisson distribution is tied to absolute numbers of counts, implies that this approach requires that the data is neither scaled nor background subtracted. Instead, the background should be part of the fit function either as a free parameter or a known constant. Furthermore, it should be noted that time bins with zero counts are as informative to the fit as non-empty ones, and should not be left out.

Generating synthetic quantum dot data

22To benchmark the CPA and clustering method and to test its limits, our toolbox provides an example routine to generate artificial data mimicking quantum dot intermittency. To obtain mimicked quantum dot data, we first choose a number m 0 of intensity levels I 0,m between which we assume the dot to switch. Next we generate switching times for each of the states. In this work, we choose all switching times from a power law distribution.

23For benchmark purposes we will present results with power law exponent α = 1.5, though any exponent can be set in the code. On the assumption that intensity levels appear in a random and uncorrelated order, this segments the time axis in a list of switching events T 0,j , j = 1, 2, . . . m 0 , where for each segment we randomly assign one of the nominal intensities I 0,m . Next, to mimic a pulsed excitation experiment, we imagine each of these segments to be subdivided in intervals of length τ L equivalent to a laser repetition rate (τ L = 100 ns

24in the examples in this work). We assign each of these intervals to be populated with one photon at probability p m = I 0,m τ L . This ensures that the number of photons N q in every segment is drawn from a Poisson distribution at mean T 0,q I 0,m . By removal of all empty bins, the binary list is translated into a list S = (t 1 , t 2 , t 3 , . . .) of photon arrival time stamps at resolution τ L to which one can directly apply CPA to attempt a retrieval of switching times, and apply clustering to retrieve the number of states.

25To also enable fluorescence decay rate analysis, we further refine the photon arrival time list. Recalling that we have generated switching events T 0,q between intensity states I 0,m , we now also assume fluorescence decay rates γ 0,m . As each segment q, was already chosen to correspond to some level m q , we now impose decay rate γ 0,mq on the photon arrival times. To do so, for each of the photon events k = 1 . . . N q already generated at resolution τ L we now randomly draw a delay time ∆ k relative to its exciting laser from an exponential distribution characterized by rate γ 0,mq . To mimic the behavior of typical TPSPC counting equipment, the delay time is discretized at a finite time resolution ∆τ (in this work chosen as 165 ps to match the hardware in the provided example experimental data measured in our lab (Becker & Hickl DPC-230), though of course in the toolbox the value can be set to match that of any TCSPC card vendor). Testing of fluorescence decay trace fitting can operate directly on the generated list of delay times, or alternatively one can synthesize a TCSPC experiment by re-assigning S to represent laser-pulse arrival times S R , and defining photon arrival times as the events in S A , S B each shifted by its delay time, i.e. S X = (t 1 + ∆ 1 , t 1 + ∆ 2 , . . .),with X ∈ A,B. Cross correlation of S R and S X returns the delay time list. We note that although our work does not focus on antibunching, our quantum dot simulation routine provides data distributed over two detector channels, where emission events antibunch, while an uncorrelated background noise level of the detectors can also be set.

Practical implementation

26We have implemented the toolbox ingredients in Python 3.8. As timestamp data can be substantial in size, we use the 'parquet' binary format to store timestamps as 64-bit integers. Processing and plotting the data is dependent on Pythons' standard libraries numpy, matplotlib, while we use Numba, a just-in-time compiler, to accelerate the time-stamp correlation algorithms. An example script to generate synthetic data, and to run the entire workflow on simulated data is provided. We refer to the supporting information for a guide to the practical implementation and use of our toolbox. The toolbox comes also with example experimental data on single CsPbBr 3 quantum dots from a recent experiment 43 under review at the same journal for intended back to back publication. Table 1 list scaling and performance metrics for the algorithms contained in the toolbox.

Results

27The remainder of this work is devoted to presenting benchmarks of the provided methods.

28Benchmarks for emitters with 'binary' switching, i.e., two well-separated intensity levels as is typical for II-VI quantum dots, have already been presented in literature. 26,32,40 However,

29Ca. 10 s for N = 10 6 Grouping Initial clustering dominates over iterative algorithm

30Overhead dominated 0.75 ms per iteration (Q < 500)

31O(N n plot points ) 8 ms per plot point at N = 10 6 Long-time autocorrelation 4 O(N n cascade ) Ca. 2s for full plot 1 For large Q this is accelerated by first clustering subsets, merging, and continuing clustering 2 Typically 5 to 10 iterations are required when n G ≈ m. 3 Numba JIT acceleration assuming int64 provides over 2 orders of magnitude accelation. A typical g (2) plot has ca. n plot points ) = 2000, and hence requires 10 to 20 seconds to evaluate. 4 Essentially repeating g (2) and logarithmic coarsening every n cascade points.

32emitters under current study, such as perovskite quantum dots appear to have a multitude, or perhaps even a continuum, of intensity levels. Our tests hence focus on determining the performance of CPA and level clustering for many-level single photon emitters. Purely for visualization purposes, the data is plotted in a binned format, as the analysis itself does not make use of any binning. Alongside the binned intensity trace, we also show the log-likelihood ratio L k . In both cases, the log-likelihood ratio clearly peaks at or close to the point where there is a changepoint in the data. Since the Bayes factor is actually a logarithmic measure for the comparison of hypotheses, the algorithm indeed identifies the changepoint with high probability and to within just a few photon events, even where the jump is far smaller than the shot noise in the binned representation in the plot, at a relative Figure 2: Demonstration of changepoint detection applied to a synthesized data set with a single changepoint, with equal photon counts before and after the changepoint. In (A) and (B) the contrast between intensities is a factor of 10 and 2, respectively, while the total photon budget is approximately 2000 and 300. The bottom panels show the log-likelihood ratio test, which clearly peaks at the changepoint in both cases. The y-axis unit cts/ms stands for counts per millisecond. The robustness of the method is demonstrated in (C) and (D), where we show the likelihood of detecting a changepoint in such a series for different intensity contrasts, and the variance of the found times, respectively, as a function of the total photon numbers. To gather accurate statistics, 10 4 photon traces were generated for each data point. The data is plotted in a binned fashion (ms bins) for visualization purposes only.

Precision of identifying individual changepoints

33intensity contrast of just a factor of 2. Generally, the probability with which the algorithm identifies or misses the changepoint is dependent on the total number of photons recorded both before and after the changepoint, and on the contrast in intensities, consistent with the findings of Watkins, and Ensign. 26 To identify the limits of CPA 29,32 we consider the feasibility of identifying changepoints of contrast I 2 /I 1 as function of the total number of photons in the time record. The results are shown in Figure 2C for the likelihood of detecting a changepoint, and Figure 2D Intermittency and on-off time histograms The input shows the initial power-law distribution, the lighter colors show the number of retrieved changepoints, after applying Poisson noise and CPA, at different contrasts, with I 1 = 10 5 . counts/s. We can see that even at low contrast, events with long times between switching are retrieved, but each contrast has a characteristic duration below which changepoints can't be accurately retrieved. This puts a fundamental limit on the information that can be extracted from a given data set. (D) An occupancy diagram illustrating the behavior of the clustering algorithm for a system with m 0 =4 intensity levels. The color scale indicates the amount of time spent in each state m i after the assignment of states for a given number of available states n G . We see that when n G > m 0 , effectively all segments are distributed across only n G ≤ m 0 intensity levels.

34As next step in our Monte Carlo benchmarking we turn to time series with many, instead of single, jumps. Fig. 3A shows a representative example for a simulated intermittent quantum dot with two states, assuming a contrast ratio between states of 2 × 10 4 and 5 × 10 3 s −1 . We generally observe that the recursive CPA algorithm accurately identifies switching events, barring a number of missed events of very short duration. From the CPA analysis we retrieve the time duration between switching events. Figure 3C shows a histogram of time durations, plotted as a probability density function obtained from a whole series of Monte

35Carlo simulated time traces of varying contrast between states (see legend). Noteably, if we simulate quantum dots that have switching times that are power-law distributed, the retrieved distribution indeed follows the assumed power-law particularly for long times. At shorter times, the histogram remains significantly below the power law, particular at low intensity ratios between the two assumed states. This indicates that CPA misses fast switching events, and is consistent with the observation from Figure 2C

Error analysis for trajectories with multiple jumps

36The changepoint analysis results in Figure 2(C) essentially quantifies the algorithm performance in terms of the fraction of correctly identified change points (true positives) for traces with a single step in intensity, as function of contrast and photon budget. Actual single emitter photon trajectories have a plethora of steps, where CPA is mainly likely to miss short segments due to the fact that only those changepoints are accepted for which the evidence in the data is compelling, relative to the shot noise in it. Indeed, the short-time rolloff in Figure 3C highlights exactly this tendency of CPA to under-report on closely-spaced changepoints (false negative rates high for short segments). The level of skepticism set as parameter for running CPA sets the overall accuracy of the algorithm, essentially trading off the rates of false positives, and false negatives. When using the toolbox for a particular photophysical scenario, the reader is recommended to study the error rates as function of skepticism. To demonstrate that type of study, here we report on algorithm performance as function of skepticism using the error metrics accuracy, precision and recall. To this end, we generate synthetic data and match the list of nominal changepoints and retrieved change- each. If the time axis for the tolerance is chosen as short as the inverse mean count rate, the apparent algorithm precision is low, indicating that changepoints are generally found close to, but not quite at, the moment where the switching event occurs. At tolerances of 2 to 5 ms (containing of order 50-250 photons typically at the given rate, and for the various assumed intensity levels) the error rate saturates at above 90%. The accuracy for this example peaks at a skepticism of ca. 7.0 ( Figure 4A). At higher levels of skepticism, the precision increases,

37i.e., the number of false positives reduces further ( Figure 4B). However, this is at the expense of recall, i.e., the number of missed changed points. The false negatives rate decreases only with skepticism lowered to below 10 ( Figure 4C).

Performance of level clustering

38Next we consider the performance of the grouping algorithm applied to the segmentation of simulated time traces. For reference, Figure 5A shows the Bayesian Information Criterion versus n G for the example of simulated dots with m 0 = 2, 3, 4 intensity levels. Generally, the BIC rapidly rises as n G approaches the actual number of levels with which the data was The most likely number of levels is indicated by a small peak in L k . In the inset, we show that the distributions indeed peak at their respective m 0 . It should be noted that the BIC shows a very sharp rise, and then from m 0 onwards appears almost flat. There is in fact a shallow downward slope. Here one should keep in mind that the BIC is a logarithmic metric. On a linear scale the maximum is significant. (B-E) Likelihood P of finding m r levels for a simulated system, given m 0 initial intensity levels and N the mean number of photon counts. We see that the photon budget plays a defining role in the total number of states that one can reliably resolve. At low photon budgets, the number of levels is systematically underestimated, whereas at high photon budgets, P (m i = m 0 ) remains high even at high m 0 . We see that m r is never overestimated.

39to the penalization of the BIC by the number of fit parameters. Since the BIC criterion actually relates to the logarithm of the probability with which n G states are the appropriate description of the data, even an apparently gentle maximum in BIC actually coincides with an accurate, unique determination of m 0 .

40To gauge the accuracy of the retrieval of the number of states for multi-state quantum dots, we simulated quantum dot data with power-law distributed (α = 1.5) switching events, assuming switching between fromm 0 = 2 to 10 equally likely levels, where we assumed intensity levels to be assigned to segments randomly, and where we assumed levels for simplicity evenly spaced from dark to bright. Lastly, all segments were reassigned an intensity according to Poisson statistics. In other words, we added shot noise. Figures 5D, E), the retrieval of the number of states is indeed robust, even for simulated dots that switch between as many as 10 intensity levels. At low total photon budgets ( Figures 5B, C), we see that m r is often underestimated. This signifies that there is high uncertainty due to shot noise in the assigned intensity levels, so that levels can not be discriminated within the photon budget. It is remarkable that at photon budgets of 10 6 photons, as many as 10 intensity levels can be robustly discerned even though the smallest contrast between levels is as small as 10% in intensity in view of Fig. 2, where it is evident that detecting changepoints for small intensity jumps is difficult. Here, however, one should realize that in contrast to Fig. 2C, where single small-contrast changepoints are studied, here many levels are visited in a random order. Thus the correct detection of small level differences is not reliant on the detection of small changepoint contrasts, but on having sufficient photon statistics to resolve the segment count rates of already identified segments.

41As a secondary metric, additional to the BIC, is in how the clustering algorithm assigns occupancy to the levels. The clustering algorithm assigns to each data segment the most likely intensity level that it was drawn from. Occupancy is a metric for how often each of the n G levels available to the algorithm is actually visited by the measured intensity sequence.

42We find that if one allows the clustering algorithm to use more levels than originally used to synthesize the quantum dot data (n G > m 0 ), the additional levels take essentially no occupancy. We show this in Figure 3D for an example of a dot assumed to have four intensity levels with a total photon count of 5 × 10 5 . As soon as additional states (m ≥ 5) are offered to the grouping algorithm, these additional states take no occupancy and do not change the distribution of segments over the states found at the correct m. Thus we confirm again that the grouping algorithm does not over-estimate the number of states. This limit of our benchmarking space zooms in on the regime where CPA intrinsically fails ( Fig. 2(C)). In this regime, the originally assumed bimodal quantum dot behavior no longer results in a bi-modal FDID. Instead a significant broadening is evident. We can conclude that for most realistic quantum dot systems, CPA-generated FDIDs will not suffer from this artificial broadening artefact.

Conclusion

43In this work, we have provided a Python toolbox for change-point analysis, and for determining the most likely intensity level assignment for intermittent multilevel emitters. We investigated the limits of changepoint analysis and clustering as fundamentally set by photon budget, and for the case of many state emitters. We have shown that for long switching times, the typical power-law behavior of many quantum emitters can be accurately retrieved.

44We also show that in the case of many-state emitters, the number of intensity levels can be retrieved with high fidelity, provided the photon count is high enough. At low photon counts, the number of states is systematically underestimated. This shows in which way the photon budget puts a fundamental limit on the amount of information that can be retrieved from a given TCSPC data set. We show that the photon budget also poses a limitation on the accuracy at which the slope of a single-exponential decay can be retrieved. Additionally, we investigate the commonly used intensity-decay time diagrams. We show that with CPA, a two-state simulated quantum dot is well-represented in an FDID, but when a cutoff is introduced to match that commonly found in literature, the states become increasingly poorly defined in an FDID representation. While the Bayesian inference algorithms in this toolbox were reported earlier for application to quantum dots with just two or three intensity states, this toolbox and the provided benchmarks point at the applicability even to emitters that jump between many closely spaced intensity levels, which will, in our view, be of large practical use for many workers analyzing the complex photophysics of, e.g., perovskite quantum dots. Also, the toolbox can be used for theory development, following a workflow in which hypotheses are cast in synthetic photon counting data, which in turn can be subjected to the CPA analysis suite, to assess how hypothesized mechanisms express in observables, and in how far they are testable. The limit of this testability generally depends on an interplay of total photon budgets, residence time in each level, intensity contrast between levels, and segment durations. For a given photophysics scenario, the user can easily deploy the toolbox to directly assess data segmentation in terms of accuracy, precision and recall error rates, in dependence of the level of skepticism that the user wishes to apply in order to accept assertions regarding the segmentation of data in segments and intensity levels. These error rates, and hence the testability of a hypothesized photophysics scenario, are ultimately limited by the evidence in the counting statistics, and not the segmentation algorithm.

Supporting Information Available

45Detailed manual to the code and description of the example data set.

Supporting information -manual to the Python code

46In this supplement, we will discuss the different uses of the Python toolbox for unbiased statistical analysis. The toolkit accepts both data taken in a TCSPC measurement and data created in Monte-Carlo (MC) simulations. The code, and this manual are. We will first discuss the data processing of photon time stamp files, and subsequently the provided routine to simulate m 0 -level single photon emitters.

47Processing toolbox -overview Figure 8: Flow chart of the processing toolbox described in the main text. Figure 8 shows the different parts of the data analysis tools provided in the toolbox, and describes a workflow to perform a full analysis. The diagram shows main functions as dark blue ellipses, input and output files as green boxes, with blue frames indicating groupings or related tasks the code performs.

48The starting point for the code is a provided set of three lists of timestamps, which represent three channels, i.e., two photon counting channels, and a pulsed laser reference record. These timestamps are provided as sorted lists of 64-bit integers through "parquet" files. To convert integer timestamps to actual times, the user can specify a discretisation unit, which for experiments would generally be the intrinsic binsize of the TCSPC card used. The data is expected to be in "reverse start-stop" format as usual for TCSPC experiment, meaning that the pulsed laser reference trace contains time stamps for the laser pulses immediately after each photon event. Simulated data is simulated with a user specified intrinsic binsize and assumed pulsed excitation repetition rate.

49The processing code has the following functionality. First, the data is segmented into intervals using changepoint analysis. This returns the jumptimes at which the emitter at hand jumps in intensity, and between which the dot is constant in intensity, within the CPA threshold. Next, for each segment, the detector and photon channels are time correlated (block "segmented correlations") to obtain fluorescence decay trace photon counting histograms per segment, to which a decay rate can be fitted with the maximum likelyhood method (MLE). These processes lead to a set of intermediate, ASCII-formatted files that contain the segmented jumptimes, intensities and decay rates. The reminder of the routines are found on the right hand side of the diagram. The top block "timestamp related functions" acts not on the segments, but on the timestamp list as a whole. They convert the timestamps list into time-correlations between detectors, and detector and laser, across the whole dataset, to provide a decay trace, g (2)(τ ) and long-term autocorrelation trace. The remainder of the blocks post-processes the segmented data. This includes on one hand grouping according to Bayesian analysis, and on the other hand plotting of the segmented data as time traces, FDID diagrams, and switching time histograms.

50The philosophy of the code is that it can interchangeably run on experimental and simulated data simply by setting a Boolean switch in the code. The Boolean switch redirects the routine to take information from the preamble XXX.py files, where XXX points to experimental resp. simulated data. The preamble files contain the input and output data file paths and required metadata for processing. The input time stamps are taken from the folders labelled Data XXX, while the output is saved in the folder Output XXX with Each function can be run independently provided that any required intermediate files have already been generated.

51To demonstrate a complete run through the entire workflow, we provide the script En-tireWorkflowScript.py. This script is just a sequence of independent function calls, with no passing of variables between functions. We note that to work with experimental example, the user needs only run or adapt EntireWorkflowScript.py. For exploring a large variety of simulated problems, it suffices to run the simulation routine (see below), and work with EntireWorkflowScript.py, largely without need to adapt preamble simulated.py.

52Under the hood, the actual dataprocessing algorithms are contained in the four basic routines:

531. CPA functions.py -segments the timestamp file using changepoint analysis 2. grouping functions.py -clusters lists of jumptimes and counts per segment into the most likely set of levels, according to Bayesian information criterion.

543. correlate jit.py -contains the timestamp-based channel auto and cross-correlation algorithm reported by Wahl et al. 49 It provides decay trace histograms when correlating photon and laser channel, used for both segments ("segmented correlations") and aggregate data record ("unsegmented correlation"). It provides g (2) (τ ), when giving detector channels A and B as task to correlate, and it provides on a logarithmically coarsened time axis the normalized intensity autocorrelation to perform the intermittency analysis proposed by Houel et al 31 The remainder of the routines are for file input-output, bookkeeping and plotting, relying on the core routines listed above for the actual work.

Segmenting the data

55Module name: CPA wrapper.py Input files: timestamps chX bin.parquet Output files: metadata dataset.txt, segmentbounds.txt

56In this script, the data -experimental or generated by the dot-simulation routine -is segmented according to the user's instructions. The script loads the data from three parquet files, which are binary data files containing all the photon event timestamps on the three channels: the two measurement channels from the Hanbury-Brown Twiss setup of photodetectors, and the reference channel. This is a ubiquitous setup for single-photon detection, but we note that, in the case of a different number of detectors, the code can be adapted to accommodate for this, as in most scripts (except for g(2)(τ )), the events from the two photodetectors are merged into a single list.

57The script initially retrieves a number of properties about the data, such as the number of counts in all channels, and the length of the time record (timing of the last events), which together with the timing bin width (specified in preamble.py) are written to a metadata file. This file also includes a retrieve time offset between channels A, B and R estimated from the data. That is, an event on a detector and the corresponding reference event will be offset by (1) the time it takes for the emitter to decay, and (2) the path difference between detectors and reference diode. The quantities Tau0A bin, Tau0B bin refer to the latter. In simulated data there is no such time offset, but in experimental data there are typically optical and electronic (cable length) path differences which one needs to correct for before splicing two detector channels into a single fluorescence decay trace.

58The script next calls cpa functions.py, which takes the combined photon timestamps from channel A and B as input, and returns the timestamps at which a changepoint occurs accord-ing to Bayesian inference. This routine takes the basic formalism to find a single changepoint in a dataset that has photon timestamps distributed according to exponential waiting time statistics, as specified by Watkins, 26 Ensign, 40 and in the main text. This formalism is applied iteratively to the resulting segments, subdividing them until no more changepoints are found. The routines returns both the timestamps (jump times t 0 , t 1 , t 2 , ...) and the associated photon event indices, which is equivalent to the cumulative number of counts up to the time of the jump. The single-changepoint detection routine requires a level of 'skepticism' to accept or reject changepoints, set in the preamble python file. For an explanation on the which values are appropriate, we point the reader to 26 and. 40

Lifetimes per segment

59Module name: segmented crosscorrs.py Input files: timestamps chX bin.parquet,segmentbounds.txt Output files: corr seg.txt, segment fit data.csv This script again imports the photon events from the parquet files, as well as the segment bounds (jumptimes) calculated and exported by CPA wrapper . Looping through the segments, the events on either detector are correlated with the events in the reference channels using correlate jit, following the method of. 49 The correlations are calculated over a time range equal to the (assumed) repetition rate of the excitation laser. This gives two 2 × Q − 1 × q matrix, with Q the number of found CPA jumps (including time series start and stop) and q the ratio of τ L the time between excitation pulses over the timing card resolution. Thus each each of the 2(Q − 1) (factor 2 for the two detectors) rows represents a fluorescence decay histogram for a segment. Since the correlation calculations can be quite lengthy, they are saved to corr seg.txt, for loading as needed. In addition, we speed up these calculations significantly by making use of Numba, which is a so-called just-in-time (JIT) compiler. This allows a specified section of Python code to be accelerated by just in time compilation. For these segmented correlations, this gives a speedup of between one and two orders of magnitude. This JIT compiler is applied for all correlations calculated, others including the g 2 (τ ), the full decay trace, and the coarsened autocorrelation.

60Following the interpretation-agnostic conversion from timestamps to decay histograms per segment, an exponential decay (by default single exponential -several other dependencies are preprogrammed and could be chosen by the user) is fitted to each segment. This is done using the maximum likelihood estimator (MLE) relevant to Poisson statistics, explained by Bajzer et al. 50 through the routine fitexp MLE. Before fitting, the data is prepped. This includes timeshifting the photon channels such that the peak of the decay histograms lands at τ = 0 (each might have a different shift, determined by the routine as Tau0A bin and Tau0B bin), reversing the time axis (exponential decay tail towards positive time, undoing reverse start stop) clipping out negative times (detector rise), and includes an option for clipping out user-specified data intervals. This is useful for experimental data, where electronic ringing in DPC/TCSPC chips sometimes causes artefacts that should not be fitted. Note that excluding this range from the fit is not the same as setting the counts for this range to zero, instead removing them entirely.

61After the data prepping per detector channel, the detector channels are spliced, so that decay rates are determined from the full photon record (sum of both detectors). Importantly for MLE-fitting of Poisson distributed data in which the probability distribution is linked to absolute count values, the data is neither scaled, nor background substracted. By fitting a single exponential A exp(−iγt) + b, three values and their respective errors are obtained. The routine exports A, γ, the error in γ, and b. It should be noted that in the subsequent processing routines only γ and δγ are used, as the best estimate for the count rate per segment simply follows from the number of counts in a segment N q divided by the segment duration T q (error follows from the square root of the number of counts, divided by the segment duration). The fitted values are saved, and can be reloaded as a pandas dataframe in segment fit data.csv. The fit routine starts from an initial guess for parameter values that are estimated from the data itself. For insightful explanations of the maximum likelihood estimator, we refer the reader to. 50?

Grouping, determining most likely levels

62Module names: grouping wrapper.py Input files: segmentbounds.txt Output files: grouping.txt This routine operates on the result of CPA wrapper, i.e., the file segmentbounds.txt produced by it. This consists of a list of jump times (t 1 , t 2 , ..) and (cumulative) counts per segment, which convert into segment durations T q = t q − t q−1 , counts per segment N q and per-segment count rates I q = N q /T q . Following the main text, the segments are clustered into a first guess for the actual Bayesian grouping analysis using a recursive hierarchical clustering algorithm that crawls through a data set of Q − 1 segments in Q − 1 steps, in each step grouping the segments with the nearest intensity together. We find that the final result of the Bayesian grouping analysis is not very dependent on this initial guess, which allows for a shortcut. For this reason we us a faster version of the original hierarchical clustering proposed by 26 for large data sets, which consists of hierarchically grouping small blocks of 300 subsequent segments to 30 levels each, concatenating those, and then grouping. The result is groupings of the data in a range of n G levels (in our analysis we didn't go beyond (n G ) = 20).

63After this initial guess, the segment allocation to intensity levels, and the level-values are optimized following Section 2.3.2 of. 26 Here, the segments, divided into exactly n G groups by the initial hierarchical clustering, are iteratively swapped out, until the most likely grouping on the assumption of exactly n G levels is achieved, with the best estimate for the intensity levels. Thus for each hypothetical distribution in n G ∈ mingroups, ..., maxgroups levels, the most likely assignment of each segment to an intensity level I 1 , ...I n G is determined. This gives a "trajectory" of the emitter through the different levels, and is the which-level information for each segment, for each of the tested n G . Finally, to determine which value of n G most likely describes the data, the Bayesian Information Criterion (BIC) is calculated as function of n G . This gives the likelihood of a given n G to be the true, underlying set of levels. For simulated m 0 -level dots indeed, the BIC peaks at n G = m 0

64The grouping routine returns its result as plots and ASCII data in grouping.txt. This data folder contains three sets of information. The first is a list of the values of the Bayesian Information Criterion, discussed in the main text and shown in Fig. 4a. The second is a square matrix, where the values b n G ,m describe the fraction of time spent in state m, given that the grouping algoithm had n G intensity levels available to it. This yields figures such as Fig.4b in the main text. Lastly, the file contains a 2D matrix that describes the "trajectory" of the emitter through the available levels, given that n G levels are available to it. There is no figure of this in the main text, though Fig. 1D. provides a sketch.

65Postprocessing segmented data, plot routines Time trace

66Module names: plot timetrace.py Input files: timestamps chX bin.parquet, segmentbounds.txt, segment fit data.csv Output files: none

67This script functions purely as a visualization of the behavior of the emitter as a function of time. For plotting purposes the photon events are binned in equidistant time bins to obtain an intensity trace in time, which is plotted alongside the intensities and decay rates retrieved by CPA (i.e., without any binning). Additionally, a histogram of the intensity levels in the time trace is plotted. This is an unweighted histogram, where all CPA-determined segments have equal weight, independent of their duration. The routine also plots a time trace of the fitted decay rates with its corresponding histogram besides it. For plotting purposes, the routine attempts to guess reasonable plot axes from the data.

Switching time statistics

68Module names: switchingtimehistogram.py Input files: segmentbounds.txt Output files: switchinghist.txt

69In this section of the code, the time durations T q of all found CPA segments are taken into a histogram with logarithmic bin, implementing apropriate normalization to convert the segment durations to a segment duration probability distribution function distribution. Next, the routine fits a power law, as typically observed for many single emitters follow in their on/off times. Because CPA is more likely to miss switching events if they are very short (segment with < 50 to 100 photons), the found histogram will slope off from the initial power law at short switching times. The routine will therefore fit a power law to the part of the curve at larger switching times than a chosen threshold value. It uses the minimize module from scipy.optimize to do a least-squares fit to the data, reporting as output the fitted power law exponent and a plot to assess the quality of fit.

FDID and FLID diagrams

70Module names: FDID wrapper.py Input files: segmentbounds.txt, segment fit data.csv Output files: FDID.txt, FLID.txt

71In this script, the segment intensities and segement-resolved decay rates are compiled into fluorescence decay rate intensity diagrams (FDIDs) and/or fluorescence lifetime intensity diagrams (FLIDs). Either of these diagrams can be made by setting a boolean in EntireWorkflowScript.py. For these processes, the I q , γ q values of all segments exported into segment fit data.csv from CPA wrapper.py are used to build the 2D histograms. The process is nearly identical for either diagram, after decay rates and the error thereof are converted into lifetimes, and both options are contained in the same routine. For the FDID and/or FLID, instead of simply compiling a histogram of square bins, each segment contributes a smooth 2D Gaussian, the widths of which are determined by the error on the segment decay rate and the estimated uncertainty in the count rate for that segment, derived from the fact that counts per segment are Poisson distributed. The weight of each Gaussian is defined as its integral. As explained in the main text, three different definitions of weight per segment can be used: (1) all CPA segments have the same weight, (2) the weight of a segment is determined by the number of photon events in it, (3) the segment weight is determined by the time duration of the segment. When applying weighting, it is the volume under each 2D Gaussian that is weighted. A single routine FDID functions constructs the FDIDs and FLIDs as sum of Gaussians, with the desired choice of weight passed as argument from the routine FDID wrapper that handles file input, and plotting. For plotting purposes, the wrapper routine attempts to guess reasonable plot axes from the data. The resulting FDIDs and FLIDs are output as ASCII files and plots. Output:

72• FDID prio none and/or FLID prio none, 2D array, the FDID/FLID where all CPA segments have the same weight

73• FDID prio cts and/or FLID prio cts, 2D array, the FDID/FLID where the CPA segments are weighted by the amount of counts This script converts the segmentation results from CPA wrapper into correlative plots that highlight if there are memory effects and correlations between segment observables. The routine reads in segment fit data.csv, i.e., sequencies of intensities I q , the fitted decay rates γ q , and segment durations T q . Due to the large range of segment durations, plots are based on log 10 T q . The generated plots report on:

741. Aging: Time trace of I, γ and log 10 T q versus 'wall clock time'. In these figures, the aging of an emitter can be observed, e.g. if the dot becomes dimmer over time, or segment lengths grow or shrink.

752. Concurrent observable correlations A set of 2D histograms of the log 10 T q versus (1) intensity I q and (2) the fitted decay rate γ q . This can be used to detect if there are correlations between these quantities. These diagrams are anaologous to FDID or FLID diagrams, which are just 2D histograms of I q versus γ q .

763. Memory A set of 2 × 3 2D histograms, which plot conditional probabilities of x n against x n−1 and x n 2 , with x ∈ I, γ, log 10 T q . These are 2D histograms that examine the same observable along both their axes, but at subsequent steps in the segment history. For instance, plotting γ n against γ n−1 highlights if subsequent decay rates are uncorrelated, or correlated.

774. Segment sequence autocorrelations of the lists I q , γ q and log 10 T q . Note that autocorrelating a list such as I q is not equivalent to calculating the intensity autocorrelation, i.e., autocorrelating I(t) as provided by Houel autocorr.py, since the segment intensity list I q contains intensity levels of segments with highly unequal duration, whereas the autocorrelation of I(t) depends on the switching dynamics in time. The segment sequence autocorrelation brings out the number of switching cycles over which the correlated observable shows a memory.

Unsegmented data analysis

78Decay trace and fit, entire dataset

79Module names: unsegmented crosscorrs.py Input files: timestamps chX bin.parquet Output files: corr unseg.txt

80The entire data set is processed by correlate jit to obtain the correlation between detector channel and reference channel, leading to two decay traces (for detector A, and B). As in the case of the segmented decay trace determination routine, this data corrected by zeroeing the time axis, reversing the start-stop reversed time axis and removing the detector artefacts (risetime, electronic ringing). The two detector channels are then merged to obtain a fluorescence decay histogram. To this, an n-exponential curve can be fitted. The same Poisson-MLE is used as for the unsegmented data. Using the Minimize function from the Scipy Optimize module, we minimize our merit function such that a n-exponential decay

81is fitted to the calculated decay trace. Here, A j and γ j are the proportionality constants and the decay rates of the decay j, respectively, and b describes constant background noise.

82When fitting, we optimize for A j , γ j , B. How the fit merit function is calculated from the data and the fit function is discussed in the main text.

83Autocorrelation g (2) (τ )

84Module names: g2 tau.py Input files: timestamps chX bin.parquet Output files: g2.txt This function reads the photon detection time stamps from parquet file, and then calculates the unnormalized intensity autocorrelation g (2) (τ ) by correlating the two detector channels following the method outlined in 49 to obtain g (2) (τ ). For data taken in a Hanbury-Brown Twiss setup, this should reveal antibunching, as is the case for the example experimental data set. The simulated data generated by running the provided routine also antibunches. It should be noted that the routine does not correct for relative constant offsets in channel timings due to, e.g., differing electronic delays (cable lengths), which, if present, expresses as a small shift of the the g (2) (τ ) along the the time-axis.

Long-time intensity correlations

85Module name: Houel autocorr.py Input files: timestamps chX bin.parquet Output files: Houel autocorr.txt Houel et al. 31 proposed that intensity autocorrelations on the time scales of milliseconds to seconds express an unbiased assessment of intermittency characteristics, relating at least for binary on/off behaviors to power law exponents of dwell times. While Houel et al. operated on intrinsically timebinned data (camera frames), we provide a routine that operates directly on timestamps. The routine Houel autocorr.py reads in timestamps for two detector channels from Parquet files, splices the two channels in a single array of time stamps, and then calls correlate jit to autocorrelate the timestamp array. In view of the large time span over which the correlation is requested compared to the time-discretization intrinsic to the data (second versus 0.1 ns), a standard correlation as used for g (2) (τ ) is prohibitively slow. Therefore correlate jit provides a version of the timestamp correlation algorithm with logarithmically increasing steps in τ through a data coarsening approach as outlined in. 49 As opposed to the unnormalized g(2) for antibunching, now the output that we refer to as ACF is normalized. To ACF-1 a powerlaw with exponential roll off

86is fitted where we use the minimize function of Scipy's Optimize module and a least-squares fit. According to Houel et al. 31 the fit parameters trace back to power law exponents in the case of binary (on/off) intermittency.

Auxiliary routines

87The role of the remaining routines in the processing toolbox is • acc functions.py contains shorthand for auxiliary mathematical functions, and 2D plot color map • EntireWorkflowScript.py example script executing full sequence of processing steps. Booleans in the file set the requested tasks (e.g., simulated or experimental data), but otherwise no data is passed from function to function. The only dependency is through the intermediate data files

88• loaddata functions.py contains file input output commands for reading and writing the various files in the appropriate formats and directories

89• pypreamble measured.py contains the file paths to the example experimental data, and required output data, as well as metadata required for processing. These include the TCSPC discretization bin size of the experiment (0.165 ns, Becker and Hickl DPC-230) and the laser repetition rate (10 MHz) in the experiment that generated the data.

90• pypreamble simulated.py contains the file paths to simulated emitter data, and required output data, as well as metadata required for processing. It should be noted that parameters required for processing, i.e. the assumed time bin discretization unit and laser repetition rate need to be specified in the file, and need to be consistent with how the data was generated. They are not automatically passed from the simulation routine to maximize the direct exchangeability of experimental and simulated data for testing the toolbox.

Binning instead of using CPA

91In the sections above, we have discussed the analysis following segmentation of the data using CPA. However, the same analysis can be applied following segmentation using equidistant bins. If the user is interesting in applying equidistant binning, this can be done by flipping the Boolean CPA insteadof binned in the workflow module. The output from this segmentation and analysis will be saved in separate folders, to avoid overwriting CPA-sectioned data. The only script that will not work when equidistant binning is applied, is of course switchingtimehistogram, as its function starts off with building a histogram of the duration of the segments.

Simulate N-level emitters

92Module name: simulate qdot.py Output files: timestamps chX bin.parquet, nominalsegmentation.csv

93We provide a routine to generate time-tagged data of an m 0 -level single emitter for Monte Carlo simulations testing the toolbox, or for testing how assumed photophysics would appear in experiments. This routine is provided in a separate folder from, and is in terms of code independent from, the processing toolbox. It produces timestamps in parquet file format that, together with an appropriately specified preamble simulated.py file can be processed in exactly the same manner as the example experiment data set .

94In this section, we will describe the method used to simulate time-tagged data of an m 0 -level single emitter with MC simulations. The entire workflow of generating a dot can be executed by running entire simulate qot workflow.py. This script generates photon time stamps, and also creates plots and a reference datafile to examine the assumed and simulated intermittency behavior.

95The simulation of the emitter behavior happens in a number of steps, as follows:

Drawing the segmentation information

96First we randomly draw the random segmentation sequence according to which the photon time stamps will be subsequently randomly drawn, using the following procedure:

971. The user specifies the number of levels nlevels= m 0 , and the associated nominal intensity levels, decay rates, and dwell-time power law exponents through the preamble file.

2.

98A random list is created with indices that label the order in which the intensity levels are visited. For each entry in the list, the index is drawn independently and all levels have equal likelihood. If an entry is a direct repeat of its predecessor, it is removed from the list. The segment lengths are drawn using the following formula ?

99where a is the short time cut off Tshortest ns, b is the long time cut offTlongest ns, and β is 1 − α, with alpha the specified power law exponent for the given level.

100x is a random number generated with numpy's random.rand module, and has units of dtau ns.

Drawing photon events

101The next step is to draw photon timestamps according to the randomly drawn segmentation sequence. The segmentation sequence specifies a list of jump times t 1 , t 2 , ..., t Q and a concomitant sequence of levels visited, which specifies the nominal count rate, and decay. We draw the photon events in a two step process:

1021. Since we envision simulating a single emitter in a pulsed experiment, every laser repetition cycle there can be at most one photon resulting from an excitation event. That means that for a given nominal count rate there is a known probability p that one photon is generated. We thus draw photon time stamps with a resolution equal to the laser repetition time τ L by separating a segment of length T q in T q /τ L bins, drawing for each bin a random uniformly distributed number between 0 and 1, and conclude that a given cycle corresponds to a photon if the corresponding drawn random number exceeds p. In the provided example, τ L = 100 ns, which gives the granularity with which the time stamps are defined at this step. The probability of a photon event is given by p = I q × τ L . It should be noted that drawing rare events according to uniform distribution results in Poisson distributed count rates upon binning. Programmatically, only the list of timestamps labelling laser cycles with a resulting emitted photon are kept, and stored in list timestamps chR bin. This ultimately is the reference channel for the simulated two-detector TCSPC measurement.

1032. Next we fine-grain the photon time stamps, to account for the fluorescent decay trace. For each timestamp in the reference channel, a photon arrival time relative to the laser pulse is drawn through numpy's random.exponential module, with the appropriate decay rate from g lst for the relevant segment.

1043. from a memory management viewpoint, step 1 is prohibitive if applied to the entire desired time trace (typically 10 11 laser cycles, for only 10 7 photon events), so we apply it segment by segment. To avoid the slow python append function, the timestamps are stored in a preallocated, overdimensioned container array, which is clipped to size after generating all the time stamps. Since we provide a simulation toolbox to mimic TCSPCS experiments, all times are expressed as integer multiples of an assumed card binsize dtau ns. This allows us to express all time quantities in int64 format.

1054. uncorrelated dark noise for two detector channels is drawn according to step 1, with in step 2 a uniform random arrival time distribution.

Distributing events over channels

106The outcome of the previous step is a set of time stamps timestamps chR bin corresponding to laser pulses with a concomitant detection, and a list of delay times relative to the laser pulses. These are translated into antibunching detector channels as follows:

1071. We construct photon arrival time stamps in reverse start stop, by taking timestamps chR bin adding the delay times, and subtracting the duration of exactly one laser period. This leads to a list of photon time stamps timestamps bin.

1082. For each event in timestamps bin we randomly assign it to detector channel A or detector channel B, with equal and independently drawn probability.

1093. Finally we splice the generated uncorrelated detector noise events noiseclicks chX with X ∈ A, B into the data stream. The concomitant laser pulse arrival times was previously sent into timestamps chR bin.

110These operations ensure that the two simulated detector channels will show antibunching in g (2) (τ ), with a visibility limited by the signal to background count rate. The background noise photon events are only added now, as adding them earlier would cause the noise to antibunch as well.

Input and output files

111The simulation module requires input parameters, which are specified through the module preamble for simulation.py. The input parameters include parameters of the simulated emitter (number of levels, concomitant nominal count rates, decay rates, and power law exponents) and of the simulated measurement (laser repetition time, time discretization bin size, background count rate, and total wall clock length of the measurement record).

112It is important to note that most of the variables are independent of the variables used for processing the data, except the variables that pertain to the properties of the "measurement" itself. These are what in a measurement corresponds to the timing resolution of the counter card and the repetition rate of the excitation, called dtau ns and minitimebin ns respectively. When analyzing simulated data, the values of these two variables must be the same as in data generation.

113As output three lists of timestamps, with timestamps as 64 bit integers in units of the timing resolution dtau ns, representing two detectors in a Hanbury-Brown Twiss configuration, and a laser pulse reference channel for both. These are saved in a compact binary format as parquet files. As a service to the user, the simulation writes out the datafile nominalsegmentation.csv with the jump times, and the concomitant sequence of nominal segment count rates and decay rates according to which the data was drawn. This can e.g. be used to check the accuracy of the CPA, grouping, and lifetime fitting routines.

Example experimental data

114We provide select example data sets with the toolbox that were obtained on a CsPbBr 3 quantum dots, as reported in Ref. 43 (dots 2, 4, 6, 8, 16, with reference to supplement of that paper). While the full experimental protocol is reported in that paper, here we report the information pertinent for interpreting the time tagged data. The data was obtained using pulsed excitation at 10 MHz repetition rate (LDH-P-C-450B pulsed laser diode, PicoQuant) at 10 MHz, with confocal excitation and collection through an oil objective (Nikon Plan APO VC, NA=1.4). Detection was on two fiber-coupled avalanche photodiodes (APDs) (SPCM-AQRH-14, Excelitas) in a Hanbury-Brown & Twiss configuration. The APDS were coupled to a photon correlator (Becker & Hickl DPC-230). It uses a 0.165 nm temporal binsize, and simultaneously records absolute photon arrival times from both APDs, and the arrival times of laserpulses subsequent to photon detection on any detector. We note that this means our decay traces are taken in reverse start-stop configuration, as is standard in TCSPC to reduce data rates. A small time interval centered at around 30 ns is subject to an electronic artefact which we attribute to a ringing in the DPC-230 TDS timing chips. This interval is included in the supplied data -the toolbox is set up to exclude it from the analysis. Our measurements are taken over 120 seconds of acquisition time. The timetagged data was converted from the Becker and Hickl dataformat using C# code that uses the Becker and Hickl SPCM DLL toolkit. We note that the data of any of the TCPSC/timetagging equipment vendors can be analyzed by our toolbox, provided it is converted from proprietary format to timetagged channel data, saving the timetag lists expressed in units of the card bin size as ordered 64-bit integer arrays, with a single parquet file per channel.

Dependencies

115The code is posted on GitHub https://github.com/AMOLFResonantNanophotonics/CPA/. This code has been developed in Python 3. 8

Archived versions

116The first version of the code, and the example data sets are archived via DOI:10.5281/ zenodo.4557226

참고문헌 55건

  1. Interfacing single photons and single quantum dots with photonic nanostructures Reviews of Modern Physics · American Physical Society · 2015 10.1103/revmodphys.87.347
  2. Nanocrystals of Cesium Lead Halide Perovskites (CsPbX<sub>3</sub>, X = Cl, Br, and I): Novel Optoelectronic Materials Showing Bright Emission with Wide Color Gamut Nano Letters · American Chemical Society · 2015 10.1021/nl5048779
  3. Continuous Distribution of Emission States from Single CdSe/ZnS Quantum Dots Nano Letters · American Chemical Society · 2006 10.1021/nl060483q
  4. Bayesian Single-Exponential Kinetics in Single-Molecule Experiments and Simulations The Journal of Physical Chemistry B · American Chemical Society · 2009 10.1021/jp903107c
  5. Single pentacene molecules detected by fluorescence excitation in a<i>p</i>-terphenyl crystal Physical Review Letters · American Physical Society · 1990 10.1103/physrevlett.65.2716
  6. Fast calculation of fluorescence correlation data with asynchronous time-correlated single-photon counting Optics Express · Optica Publishing Group · 2003 10.1364/oe.11.003583
  7. Autocorrelation Analysis for the Unbiased Determination of Power-Law Exponents in Single-Quantum-Dot Blinking ACS Nano · American Chemical Society · 2014 10.1021/nn506598t
  8. Pad�-Laplace method for the analysis of time-resolved fluorescence decay curves European Biophysics Journal · Springer Science+Business Media · 1990 10.1007/bf00183269
  9. Facts and Artifacts in the Blinking Statistics of Semiconductor Nanocrystals Nano Letters · American Chemical Society · 2010 10.1021/nl100030e
  10. Bright Future for Fluorescence Blinking in Semiconductor Nanocrystals The Journal of Physical Chemistry Letters · American Chemical Society · 2010 10.1021/jz100321z
  11. Synthesis and characterization of nearly monodisperse CdE (E = sulfur, selenium, tellurium) semiconductor nanocrystallites Journal of the American Chemical Society · American Chemical Society · 1993 10.1021/ja00072a025
  12. The Fluorescence Intermittency for Quantum Dots Is Not Power-Law Distributed: A Luminescence Intensity Resolved Approach ACS Nano · American Chemical Society · 2014 10.1021/nn406562a
  13. Change point analysis of matrix dependent photoluminescence intermittency of single CdSe/ZnS quantum dots with intermediate intensity levels Chemical Physics · Elsevier BV · 2012 10.1016/j.chemphys.2012.02.018
  14. How many photons are necessary for fluorescence-lifetime measurements? Chemical Physics Letters · Elsevier BV · 1992 10.1016/0009-2614(92)87068-z
  15. Detection of Intensity Change Points in Time-Resolved Single-Molecule Measurements The Journal of Physical Chemistry B · American Chemical Society · 2004 10.1021/jp0467548
  16. The nitrogen-vacancy colour centre in diamond Physics Reports · Elsevier BV · 2013 10.1016/j.physrep.2013.02.001
  17. Single-photon sources Reports on Progress in Physics · IOP Publishing · 2005 10.1088/0034-4885/68/5/r04
  18. Two types of luminescence blinking revealed by spectroelectrochemistry of single quantum dots Nature · Nature Portfolio · 2011 10.1038/nature10569
  19. Maximum likelihood method for the analysis of time-resolved fluorescence decay curves European Biophysics Journal · Springer Science+Business Media · 1991 10.1007/bf00450560
  20. Prospects of Colloidal Nanocrystals for Electronic and Optoelectronic Applications Chemical Reviews · American Chemical Society · 2009 10.1021/cr900137k
  21. Bayesian Detection of Intensity Changes in Single Molecule and Molecular Dynamics Trajectories The Journal of Physical Chemistry B · American Chemical Society · 2009 10.1021/jp906786b
  22. Emergence of colloidal quantum-dot light-emitting technologies Nature Photonics · Nature Portfolio · 2012 10.1038/nphoton.2012.328
  23. Universal emission intermittency in quantum dots, nanorods and nanowires Nature Physics · Nature Portfolio · 2008 10.1038/nphys1001
  24. Exciton−Trion Transitions in Single CdSe–CdS Core–Shell Nanocrystals ACS Nano · American Chemical Society · 2009 10.1021/nn900296q
  25. The quantum internet Nature · Nature Portfolio · 2008 10.1038/nature07127
  26. Accurate and unbiased estimation of power-law exponents from single-emitter blinking data The Journal of Chemical Physics · American Institute of Physics · 2006 10.1063/1.2387165
  27. Colloidal CsPbBr<sub>3</sub> Perovskite Nanocrystals: Luminescence beyond Traditional Quantum Dots Angewandte Chemie International Edition · Wiley · 2015 10.1002/anie.201508276
  28. Near-optimal single-photon sources in the solid state Nature Photonics · Nature Portfolio · 2016 10.1038/nphoton.2016.23
  29. Fluorescence Blinking and Photoactivation of All-Inorganic Perovskite Nanocrystals CsPbBr<sub>3</sub> and CsPbBr<sub>2</sub>I The Journal of Physical Chemistry Letters · American Chemical Society · 2016 10.1021/acs.jpclett.5b02639
  30. Room Temperature Single-Photon Emission from Individual Perovskite Quantum Dots ACS Nano · American Chemical Society · 2015 10.1021/acsnano.5b04584
  31. Single Molecule Conformational Memory Extraction: P5ab RNA Hairpin The Journal of Physical Chemistry B · American Chemical Society · 2014 10.1021/jp500611f
  32. Reduced Auger Recombination in Single CdSe/CdS Nanorods by One-Dimensional Electron Delocalization Nano Letters · American Chemical Society · 2013 10.1021/nl4027567
  33. Direct Measurement of Off-State Trapping Rate Fluctuations in Single Quantum Dot Fluorescence Nano Letters · American Chemical Society · 2011 10.1021/nl2017674
  34. Fast Step Transition and State Identification (STaSI) for Discrete Single-Molecule Data Analysis The Journal of Physical Chemistry Letters · American Chemical Society · 2014 10.1021/jz501435p
  35. Origin and control of blinking in quantum dots Nature Nanotechnology · Nature Portfolio · 2016 10.1038/nnano.2016.140
  36. Single-Molecule Analysis beyond Dwell Times: Demonstration and Assessment in and out of Equilibrium Biophysical Journal · Elsevier BV · 2016 10.1016/j.bpj.2016.08.023
  37. Understanding the Bias Introduced in Quantum Dot Blinking Using Change Point Analysis The Journal of Physical Chemistry C · American Chemical Society · 2016 10.1021/acs.jpcc.6b09780
  38. The more the merrier: high-throughput single-molecule techniques Biochemical Society Transactions · Portland Press · 2017 10.1042/bst20160137
  39. The Degradation and Blinking of Single CsPbI<sub>3</sub> Perovskite Quantum Dots The Journal of Physical Chemistry C · American Chemical Society · 2017 10.1021/acs.jpcc.7b11168
  40. Reliable State Identification and State Transition Detection in Fluorescence Intensity-Based Single-Molecule Förster Resonance Energy-Transfer Data The Journal of Physical Chemistry B · American Chemical Society · 2018 10.1021/acs.jpcb.7b12483
  41. Excitation Intensity Dependence of Photoluminescence Blinking in CsPbBr<sub>3</sub> Perovskite Nanocrystals The Journal of Physical Chemistry C · American Chemical Society · 2018 10.1021/acs.jpcc.8b03206
  42. Excitons and Biexciton Dynamics in Single CsPbBr<sub>3</sub> Perovskite Quantum Dots The Journal of Physical Chemistry Letters · American Chemical Society · 2018 10.1021/acs.jpclett.8b03098
  43. Two types of photoluminescence blinking revealed by single quantum dot spectroelectrochemistry 2011
  44. Statistical Learning of Discrete States in Time Series The Journal of Physical Chemistry B · American Chemical Society · 2018 10.1021/acs.jpcb.8b10561
  45. Single Photon Sources in Atomically Thin Materials Annual Review of Physical Chemistry · Annual Reviews · 2019 10.1146/annurev-physchem-042018-052628
  46. Microsecond Blinking Events in the Fluorescence of Colloidal Quantum Dots Revealed by Correlation Analysis on Preselected Photons The Journal of Physical Chemistry Letters · American Chemical Society · 2019 10.1021/acs.jpclett.9b01348
  47. Silicon carbide color centers for quantum applications Journal of Physics Photonics · IOP Publishing · 2020 10.1088/2515-7647/ab77a2
  48. Memories in the photoluminescence intermittency of single cesium lead bromide nanocrystals Nanoscale · Royal Society of Chemistry · 2020 101039d0nr00633e
  49. Top-down machine learning approach for high-throughput single-molecule analysis eLife · eLife Sciences Publications Ltd · 2020 10.7554/elife.53357
  50. Memories in the photoluminescence intermittency of single cesium lead bromide nanocrystals Nanoscale · Royal Society of Chemistry · 2020 10.1039/d0nr00633e
  51. The nitrogen-vacancy colour centre in diamond Physics Reports · Elsevier BV · 2013 10.1016/j.physrep.2013.02.001
  52. Autocorrelation Analysis for the Unbiased Determination of Power-Law Exponents in Single-Quantum-Dot Blinking ACS Nano · American Chemical Society · 2014 10.1021/nn506598t
  53. Single organic molecules for photonic quantum technologies INO Open Portal · 2021 10.1038/s41563-021-00987-4
  54. Intermittency of CsPbBr<sub>3</sub> Perovskite Quantum Dots Analyzed by an Unbiased Statistical Analysis The Journal of Physical Chemistry C · American Chemical Society · 2021 10.1021/acs.jpcc.1c01671
  55. A Python Toolbox for Unbiased Statistical Analysis of Fluorescence Intermittency of Multilevel Emitters The Journal of Physical Chemistry C · American Chemical Society · 2021 10.1021/acs.jpcc.1c01670