text:
# All Questions

3answers
259 views

### Why is Bcrypt called a Key Derivation Function?

I am trying to understand why is bcrypt called a Key Derivation Function? I looked up the details of Ekfblowfish on Usenix article here: ...
2answers
416 views

### What cipher mode is suitable for independantly decryptable short messages?

I'm building a small VoIP client which transmits encrypted audio data via UDP, and some packet loss is expected, so each packet will need to be decrypted separately even if others in the stream don't ...
4answers
2k views

### Is my pseudo-random initialization vector secure?

How can I know if I am generating a secure pseudorandom initialization vector? Currently I am planning to generate a pseudo-random initialization Vector using current date and time - is this secure ...
1answer
113 views

### Top notation as exponent

In cryptography, what does the Top notation mean? It resembles a capital T: T In particular, I saw it in the follwing context: $c = (c_1,c_2)^\top$ where $c_1$ and $c_2$ are homomorphic ciphertexts ...
2answers
81 views

### How do I classify my RSA encryption strength?

So I generated 2 1024 bit prime numbers, I generated N and got a 2048 bit number, does that make my encryption 2048 bit or 1024 bit?
1answer
131 views

### Guessing the IV for CBC

If I have the key, the ciphertext under AES-CBC and the plaintext, then how can I guess the initialisation vector?
3answers
385 views

### What do numbers in a crypto algorithm stand for? Is there a convention?

What do the numbers stand for in the names of cryptographic functions, for example AES-256, RSA-1024 or ...
3answers
335 views

### Is there a 1:1 mapping between private and public EC keys?

After asking: Are all possible EC private keys valid? I learned that all 32 byte (256 bit) values greater than 0 and less than n are all valid private keys. This means that 99% of all 256 bit values ...
2answers
479 views

### Is it safe to reuse a symmetric key when using asymmetric encryption?

I've written a C# Library that I hope will be used for security purposes in a commercial application. The application will communicate through the internet and not on an internal network. I am using ...
2answers
759 views

### I hashed my bag and in it I put… “Is there a hash for unordered items?”

(By items I mean hashable objects.) As an example (with obviously way too short hashes for readability), say I packed my bag and in it I put a shovel (hashed to ...
3answers
424 views

### When is a cipher considered broken?

We've all read how some people claim AES is broken because there was supposedly a way to get the plain text from a cipher text faster than brute-force. But is this the definition? Is a cipher broken ...
3answers
283 views

### Known plaintext, unknown 128 bit block cipher

I have an encrypted configuration file from an embedded device which I'm trying to decrypt. The file seems to be encrypted in 128bit blocks, as changing a single option causes a 16 byte block to ...
2answers
243 views

### Choice of MAC and handling it correctly

I have recently learned that Encrypt-then-MAC is recommended when using symmetric encryption. I have two closely related questions related to that, which is why I am posting them as one: Looking ...
2answers
269 views

### How can one parallelize tasks in CTR-AES for maximum performance?

From what I have read it seems like one of the purported benefits of using CTR mode AES, is that it can be parallelized to a greater degree, or maybe more easily than the other block cipher modes, ...
3answers
2k views

### Problems with using AES Key as IV in CBC-Mode

I'm a pentester and currently analysing a web application which are using some strange encryption scheme. The point is: They encrypt using AES-128, generate a (not cryptographic secure) key and use ...
3answers
345 views

### Frequency of letters change by the length of the texts?

In terms of the frequency of letters, how is it possible to have different frequent letters when the length of the text I'm analyzing is shorter? At the moment, I'm comparing the frequencies of a ...
2answers
662 views

### How does this happen in RSA malleability?

I don't understand how the $E(m)$ turns into $E(mt)$. I mean, I don't know how does that transformation happen and how does the equation occur. $$E(m) \cdot t^e \bmod n = (mt)^e \bmod n = E(mt)$$ ...
2answers
2k views

### How does one deal with a negative “d” in RSA?

I'm trying to write my own RSA implementation using the textbook approach — which I know is not optimal — of picking primes $p$ and $q$, then computing Euler's totient $phi$, then randomly picking an ...
1answer
10k views

### Difference between linear cryptanalysis and differential cryptanalysis

What is the main difference between linear cryptanalysis and differential cryptanalysis? For example in relation to DES?
4answers
859 views

### Why is public key cryptography (RSA) used in sites like Google or Facebook?

The RSA algorithm is used for encryption (plain text to cipher text) and decryption (cipher text to plain text) of data. What is the need for using public keys in these sites; why is data is encrypted ...
2answers
599 views

### encrypt message with one digest 0-9 instead of 01-26

How much will the security of one-time pad decrease if I use one digit from 0-9 instead of 1-26? for example plaintext = "blue" and ...
2answers
912 views

### Benefit of combining classical substitution ciphers with modern cryptography

I know that a simple monoalphabetic substitution cipher is considered extremely weak, on account of linguistic frequency-analysis attacks. However, assume the following: cleartext is encrypted ...
1answer
733 views

### ABC Conjecture's Impact on RSA Encryption

A recent proof of the ABC Conjecture has been released by one Shinichi Mochizuki. Now, I'm not well versed in mathematics but it would appear that this proof implies that finding prime factors could ...
2answers
349 views

### Is the Blum Blum Shub PRNG suitable to create initialization vectors?

Is it a good idea to use a Blum Blum Shub Generator to create my initialization Vector (IV) in AES-OFB (Output Feedback Mode)?
3answers
160 views

### How to disguise ciphertext

If I want to have a secret conversation, then I can encrypt it (with OTR etc). However, since big brother watches all communication, sending encrypted data will likely raise flags. Does anyone know of ...
2answers
454 views

### Why is hybrid encryption more effective than other encryption scheme?

Currently I am learning about Hybrid Encryption but I was not able to find any good study material. Below is my understanding: One of the reason why we use ...
2answers
183 views

### Why do 1st and 3rd key have to be the same in 2 key 3DES?

From this answer: However, that wasn't the only situation they had in mind; they also considered the case where someone implemented 2 key 3DES in hardware (which the first and last subkeys ...
3answers
199 views

### Hash email address with a non-random salt for moderate security?

Crypto noob here. I have an application that has only moderate security requirements (internal use, limited audience). I want to send a unique url with a token in it to each user. If anyone has the ...
1answer
241 views

### I read ECB is bad because the same plaintext outputs the same ciphertext. Isn't that a requirement of a cipher?

In the Wikipedia article on Block Ciphers, it says about the Electronic Code Block mode: The disadvantage of this method is that identical plaintext blocks are encrypted into identical ...
2answers
787 views

### How to encrypt dates using format preserving encryption and avoid collisions

I'm encrypting with an FPE algorithm in C#. What I did is convert the date I want to encrypt to the day of year value and a year value like so. ...
2answers
1k views

### AES + CBC encryption for a stream of UDP packets

I am developing an application that is based on UDP, and I need to send a stream of packets. As you can imagine, packets can get lost or corrupted. I need to make sure that the content of those ...
3answers
201 views

### Cycles in SHA256

In the recommendations, it seems cycles is used usually as in "CPU Cycles", but, that's not what I mean here. What I mean, is this: Let's say I start with a particular 256 bit value. Call this v. I ...
1answer
165 views

### What is this cryptosystem called?

From a paper Outsourcing Large Matrix Inversion Computation to A Public Cloud (IEEE Transactions on Cloud Computing, Vol. 1, N°1, 2013; alternate source requiring registration; preprint), I got to ...
2answers
166 views

### What if OT breaks in Yao's garbled circuit?

Two semi-honest parties are computing F with Yao's garbled circuit. Sender garbles it with his inputs baked in then sends it to the receiver. At this point the receiver must use OT to get his keys. ...
2answers
150 views

### how to let other people respond to emails only decrypt-able with my private key

First of all I have to say it's a homework question but since I have no one to consult with, I ended up here :) Suppose a case in which you are the manager of a company and all employees encrypt ...
2answers
230 views

### Would xoring 2 independant AES CTRs to produce p-rand introduce vulnerabilities?

Assuming $$AES_{k_1}(C_1) \oplus AES_{k_2}(C_2)$$ where AES is used in CTR mode, $C$ is a 128 bit incrementing counter, keys and counters for both transforms are random as well as unique, and the ...
1answer
1k views

### Fastest random number generator

I just read High performance physical random number generator by K.H. Tsoi, K.H. Leung and P.H.W. Leong. It proposes a physical RNG of speed 400 Mbps. Is this the fastest random number generator at ...
3answers
571 views

### How do I produce a stream of secure random numbers from AES-Counter mode?

I have just made my own program to encipher, using AES in counter mode, and have validated it using NIST data. So I know I have done it properly. I have read that AES-CTR can produce a stream of ...
1answer
392 views

### SHA256-based stream cipher

Can anyone comment if the stream cipher described here is safe? The author claims it to be unbreakable, but does not provide any evidence or proof to support this. For completeness, I have reproduced ...
1answer
282 views

### Is $H(x) = x^2 \bmod p$ pre-image resistant, second pre-image resistant and/or collision resistant

I have the function $H(x) = x^2\bmod p$ , where $p$ is a prime of length n bits and this function maps to the message $x$ to a n-bit hash value $H(x)$. I need to find out if it is pre-image ...
2answers
644 views

### Seed / reseed DRBG too often?

There are limits to how much you can use a the DRBG before you have to reseed it, but are there any limits to how much you must use it before reseeding? Take the following scenarios as an example… ...
2answers
197 views

### Is there a metric (term) for work required to decrypt a public key?

Any public key decryption can be decrypted given enough time and computing power. Is there a metric or term for this? Something like it would require on average 2^43 1024 bit hashes to find private ...
2answers
169 views

### Could someone reuse client certificates?

To my understanding, if a server “cert+key” (RSA) is compromised, than the SSL/TLS network traffic can be decrypted. What about a client “cert+key” (RSA)? Could someone reuse client certificates? ...
2answers
888 views

### Difference between collision resistance and target collision resistance

For a hash function, what's the difference between Collision Resistance and Target Collision Resistance?. I understand the definition of hash function collision resistance, but I don't know about ...
1answer
336 views

### Elliptic Curve Factorization: Why are elliptic curves suited for this kind of task?

Currently I'm working on a presentation of a paper that talks about the factorization of large numbers. In the paper elliptic curves are presented as a way to factorize large numbers. After hearing a ...
1answer
488 views

### Hide a weakness in ECC by choosing the prime or one of the curve coefficients

Suppose you are given a value $c$. Can you find a prime $p$ and an integer $b$ such that the elliptic curve $$E: y^2 \equiv x^3 -3x + b \pmod p$$ is cryptographically weak? You need to choose ...
1answer
266 views

### How did they factor RSA-704?

I don't understand the 'Wiedemann algorithm' works. Can someone explain the factoring of RSA-704 in an easy way?
2answers
760 views

### Secure use-cases of block cipher with 64-bit block size

In what cases can we use a weak block cipher like DES ? More precisely, Are there specific situation in which a weaken block cipher can still be used, for instance for certain types of plaintext ?
2answers
848 views

### Why RSA uses {d,n} as private key instead of {e,n}?

While studying the RSA algorithm I referred to some books and some sites such as RSA (wikipedia) and all of them chose {d,n} as the secret (private) key and release {e,n} as the public key but as d ...
2answers
4k views

### Keys required for cryptography

I am reading an article on cryptography at following location: http://www.entrust.com/resources/pdf/cryptointro.pdf Historically, encryption systems used what is known as symmetric cryptography. ...

15 30 50 per page


text:
# Designing a 6V --> 40V step up converter [closed]

I need to design a step up converter with the following requierements:

Vin = 6V - 8.4V
Vout = 35 - 40V, Iout = 2.5A

Could anyone give me some insights on how to start it? I have found some step up schematics but could not find any that could deliver 40V and 2.5A. Any reference is well apreciated.

Best,

## closed as too broad by Huisman, Bimpelrekkie, RoyC, JYelton, FinbarrJul 2 at 8:49

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• The hardest bit of about a boost converter is what control method you are going to use. There are lots of controller ICs out there for boost converters. Texas Instruments, Analogue Devices, Maxim and many others do them. Or you could do your own controller with a suitable processor core. What work have you done so far? What typology were you planning to use? What current ripple can you live with? What voltage ripple? – Puffafish Jun 26 at 9:35
• This is a broad question. But you can start using supplier-provided tools to design this, for example Texas Instrument's Webench Power Designer, Analog Design's LTpowerCAD, and/or use simulators (e.g. LTSpice) to check and understand how a specific design works. – dim Jun 26 at 9:38
• @Puffafish, the purpose of the step up is to charge a big capacitor that moves a solenoid. Using TI Webench Power Designer, I created this circuit, but is not working properly and behaves in a strange way. Here you can see what I have done so far: drive.google.com/open?id=1260GChzKZc64UZXIM4EQjB1xFFMnanWo – alex_unio Jun 26 at 9:49
• Just in case you are thingking to make just one or two you are likely better served by purchasing a ready unit. Also I like to see what others have done and then modify existing working designs to get what I want. Sometimes simple changes can make a tacky product kind of nice, possible by hacking a ready unit or altering the design for your own production run. Commercial vendors have flogged the switching power supply horse pretty well these last 30 years. – KalleMP Jun 26 at 10:26

I would start with a selection site where you input the supply voltages and output currents and it makes recommendations based on that. The former Linear technology site is good for that (now run by Analog Devices): -

In the above picture I have pre-selected "External Power Switch Boost" (inside the red box) and added some values inside the purple box. The 2nd part in the list I chose based on what the front page of the data sheet indicated: -

As you can see, the input voltage can go down to 6 volts and the output can be up to 80 volts at 7 amps. All those numbers exceed your requirements so that design would work provided that your battery (6 volts to 8.4 volts) can supply the 100 watts of power needed.

Look at the graph on the right that shows efficiency versus load versus supply voltage. With a 6 volt supply you'll get 80 volts at about 1.7 amps. If you altered the FB voltage resistor divider, you'll get 40 volts and a similar power hence you should easily be able to achieve 2.4 amps at 40 volts.

But, don't stop there; check out other offered parts and see if the data sheet might give something that works down to maybe 5.8 volts. Cover the options. I chose non-synchronous converters in the above but try looking for synchronous converters too.

There are similar engines from TI but I find the one above to be easiest. Fly-back designs are also capable of giving you 100 watts but have maybe an efficiency of only 85%.

• Thanks Andy! Really helpful the Analog Devices tool. I am trying to solve the voltatge divider part to get 40v instead of 80V, with the schematic you posted. Could you please help me with that? What resistors values must I change to get 40V? – alex_unio Jun 26 at 14:31
• Look in the data sheet to see what the FB voltage should be. It's probably around 1.25 volts. Then ask yourself what the 796 kohm resistor value needs to reduce to when 40 volts is applied to give 1.25 volts at FB. There'll be a formula in the DS for sure. – Andy aka Jun 26 at 14:44
• Thanks for your support, Andy. I couldn't figure out the 1.25V you proposed in your last mail. I readed the datasheet but could not find a formula to calculate it. – alex_unio Jun 28 at 10:40
• Did you find the reference voltage in the data sheet on page 3? Do you know how that voltage is "made" via the potential divider (796 k and 12.4 k) from 80 volts? Do you know how to recalculate the value of the 796 k resistor to obtain "reference voltage" from 40 volts? – Andy aka Jun 28 at 10:44

format: plain


text:
# Thinking about different ways to analyze sub-groups in an RCT

Here’s the scenario: we have an intervention that we think will improve outcomes for a particular population. Furthermore, there are two sub-groups (let’s say defined by which of two medical conditions each person in the population has) and we are interested in knowing if the intervention effect is different for each sub-group.

And here’s the question: what is the ideal way to set up a study so that we can assess (1) the intervention effects on the group as a whole, but also (2) the sub-group specific intervention effects?

This is a pretty straightforward, text-book scenario. Sub-group analysis is common in many areas of research, including health services research where I do most of my work. It is definitely an advantage to know ahead of time if you want to do a sub-group analysis, as you would in designing a stratified randomized controlled trial. Much of the criticism of these sub-group analyses arises when they are not pre-specified and conducted in an ad hoc manner after the study data have been collected. The danger there, of course, is that the assumptions underlying the validity of a hypothesis test are violated. (It may not be easy to convince folks to avoid hypothesis testing.) In planning ahead for these analyses, researchers are less likely to be accused of snooping through data in search of findings.

So, given that you know you want to do these analyses, the primary issue is how they should be structured. In particular, how should the statistical tests be set up so that we can draw reasonable conclusions? In my mind there are a few ways to answer the question.

## Three possible models

Here are three models that can help us assess the effect of an intervention on an outcome in a population with at least two sub-groups:

$\text{Model 1: } Y_i = \beta_0 + \beta_1 D_i$

$\text{Model 2: } Y_i = \beta_0^{\prime} + \beta_1^{\prime} D_i + \beta^{\prime}_2 T_i$

$\text{Model 3: } Y_i = \beta_0^{\prime\prime} + \beta_1^{\prime\prime} D_i +\beta^{\prime\prime}_2 T_i +\beta^{\prime\prime}_3 T_i D_i$

where $$Y_i$$ is the outcome for subject $$i$$, $$T_i$$ is an indicator of treatment and equals 1 if the subject received the treatment, and $$D_i$$ is an indicator of having the condition that defines the second sub-group. Model 1 assumes the medical condition can only affect the outcome. Model 2 assumes that if the intervention does have an effect, it is the same regardless of sub-group. And Model 3 allows for the possibility that intervention effects might vary between sub-groups.

### 1. Main effects

In the first approach, we would estimate both Model 2 and Model 3, and conduct a hypothesis test using the null hypothesis $$\text{H}_{01}$$: $$\beta_2^{\prime} = 0$$. In this case we would reject $$\text{H}_{01}$$ if the p-value for the estimated value of $$\beta_2^{\prime}$$ was less than 0.05. If in fact we do reject $$\text{H}_{01}$$ (and conclude that there is an overall main effect), we could then (and only then) proceed to a second hypothesis test of the interaction term in Model 3, testing $$\text{H}_{02}$$: $$\beta_3^{\prime\prime} = 0$$. In this second test we can also evaluate the test using a cutoff of 0.05, because we only do this test if we reject the first one.

This is not a path typically taken, for reasons we will see at the end when we explore the relative power of each test under different effect size scenarios.

### 2. Interaction effects

In the second approach, we would also estimate just Models 2 and 3, but would reverse the order of the tests. We would first test for interaction in Model 3: $$\text{H}_{01}$$: $$\beta_3^{\prime\prime} = 0$$. If we reject $$\text{H}_{01}$$ (and conclude that the intervention effects are different across the two sub-groups), we stop there, because we have evidence that the intervention has some sort of effect, and that it is different across the sub-groups. (Of course, we can report the point estimates.) However, if we fail to reject $$\text{H}_{01}$$, we would proceed to test the main effect from Model 2. In this case we would test $$\text{H}_{02}$$: $$\beta_2^{\prime} = 0$$.

In this approach, we are forced to adjust the size of our tests (and use, for example, 0.025 as a cutoff for both). Here is a little intuition for why. If we use a cutoff of 0.05 for the first test and in fact there is no effect, 5% of the time we will draw the wrong conclusion (by wrongly rejecting $$\text{H}_{01}$$). However, 95% of the time we will correctly fail to reject the (true) null hypothesis in step one, and thus proceed to step two. Of all the times we proceed to the second step (which will be 95% of the time), we will err 5% of the time (again assuming the null is true). So, 95% of the time we will have an additional 5% error due to the second step, for an error rate of 4.75% due to the second test (95% $$\times$$ 5%). In total - adding up the errors from steps 1 and 2 - we will draw the wrong conclusion almost 10% of the time. However, if we use a cutoff of 0.025, then we will be wrong 2.5% of the time in step 1, and about 2.4% (97.5% $$\times$$ 2.5%) of the time in the second step, for a total error rate of just under 5%.

In the first approach (looking at the main effect first), we need to make no adjustment, because we only do the second test when we’ve rejected (incorrectly) the null hypothesis. By definition, errors we make in the second step will only occur in cases where we have made an error in the first step. In the first approach where we evaluate main effects first, the errors are nested. In the second, they are not nested but additive.

### 3. Global test

In the third and last approach, we start by comparing Model 3 with Model 1 using a global F-test. In this case, we are asking the question of whether or not a model that includes treatment as a predictor does “better” than a model that only adjust for sub-group membership. The null hypothesis can crudely be stated as $$\text{H}_{01}$$: $$\text{Model }3 = \text{Model }1$$. If we reject this hypothesis (and conclude that the intervention does have some sort of effect, either generally or differentially for each sub-group), then we are free to evaluate Models 2 and 3 to see if the there is a varying affect or not.

Here we can use cutoffs of 0.05 in our hypothesis tests. Again, we only make errors in the second step if we’ve made a mistake in the first step. The errors are nested and not additive.

## Simulating error rates

This first simulation shows that the error rates of the three approaches are all approximately 5% under the assumption of no intervention effect. That is, given that there is no effect of the intervention on either sub-group (on average), we will draw the wrong conclusion about 5% of the time. In these simulations, the outcome depends only on disease status and not the treatment. Or, in other words, the null hypothesis is in fact true:

library(simstudy)

# define the data

def <- defData(varname = "disease", formula = .5, dist = "binary")

# outcome depends only on sub-group status, not intervention

def2 <- defCondition(condition = "disease == 0",
formula = 0.0, variance = 1,
dist = "normal")

def2 <- defCondition(def2, condition = "disease == 1",
formula = 0.5, variance = 1,
dist = "normal")

set.seed(1987) # the year I graduated from college, in case
# you are wondering ...

pvals <- data.table() # store simulation results

# run 2500 simulations

for (i in 1: 2500) {

# generate data set

dx <- genData(400, def)
dx <- trtAssign(dx, nTrt = 2, balanced = TRUE,
strata = "disease", grpName = "trt")

# fit 3 models

lm1 <- lm(y ~ disease, data = dx)
lm2 <- lm(y ~ disease + trt, data = dx)
lm3 <- lm(y ~ disease + trt + trt*disease, data = dx)

# extract relevant p-values

cM <- coef(summary(lm2))["trt", 4]
cI <- coef(summary(lm3))["disease:trt", 4]
fI <- anova(lm1, lm3)\$Pr(>F)[2]

# store the p-values from each iteration

pvals <- rbind(pvals, data.table(cM, cI, fI))

}

pvals
##               cM          cI          fI
##    1: 0.72272413 0.727465073 0.883669625
##    2: 0.20230262 0.243850267 0.224974909
##    3: 0.83602639 0.897635326 0.970757254
##    4: 0.70949192 0.150259496 0.331072131
##    5: 0.85990787 0.449130976 0.739087609
##   ---
## 2496: 0.76142389 0.000834619 0.003572901
## 2497: 0.03942419 0.590363493 0.103971344
## 2498: 0.16305568 0.757882365 0.360893205
## 2499: 0.81873930 0.004805028 0.018188997
## 2500: 0.69122281 0.644801480 0.830958227
# Approach 1

pvals[, mEffect := (cM <= 0.05)] # cases where we would reject null
pvals[, iEffect := (cI <= 0.05)]

# total error rate

pvals[, mean(mEffect & iEffect)] +
pvals[, mean(mEffect & !iEffect)]
## [1] 0.0496
# Approach 2

pvals[, iEffect := (cI <= 0.025)]
pvals[, mEffect := (cM <= 0.025)]

# total error rate

pvals[, mean(iEffect)] +
pvals[, mean((!iEffect) & mEffect)]
## [1] 0.054
# Approach 3

pvals[, fEffect := (fI <= 0.05)]
pvals[, iEffect := (cI <= 0.05)]
pvals[, mEffect := (cM <= 0.05)]

# total error rate

pvals[, mean(fEffect & iEffect)] +
pvals[, mean(fEffect & !(iEffect) & mEffect)]
## [1] 0.05

If we use a cutoff of 0.05 for the second approach, we can see that the overall error rate is indeed inflated to close to 10%:

# Approach 2 - with invalid cutoff

pvals[, iEffect := (cI <= 0.05)]
pvals[, mEffect := (cM <= 0.05)]

# total error rate

pvals[, mean(iEffect)] +
pvals[, mean((!iEffect) & mEffect)]
## [1] 0.1028

## Exploring power

Now that we have established at least three valid testing schemes, we can compare them by assessing the power of the tests. For the uninitiated, power is simply the probability of concluding that there is an effect when in fact there truly is an effect. Power depends on a number of factors, such as sample size, effect size, variation, and importantly for this post, the testing scheme.

The plot below shows the results of estimating power using a range of assumptions about an intervention’s effect in the two subgroups and the different approaches to testing. (The sample size and variation were fixed across all simulations.) The effect sizes ranged from -0.5 to +0.5. (I have not included the code here, because it is quite similar to what I did to assess the error rates. If anyone wants it, please let me know, and I can post it on github or send it to you.)

The estimated power reflects the probability that the tests correctly rejected at least one null hypothesis. So, if there was no interaction (say both group effects were +0.5) but there was a main effect, we would be correct if we rejected the hypothesis associated with the main effect. Take a look a the plot:

What can we glean from this power simulation? Well, it looks like the global test that compares the interaction model with the null model (Approach 3) is the way to go, but just barely when compared to the approach that focuses solely on the interaction model first.

And, we see clearly that the first approach suffers from a fatal flaw. When the sub-group effects are offsetting, as they are when the effect is -0.5 in subgroup 1 and +0.5 in subgroup 2, we will fail to reject the null that says there is no main effect. As a result, we will never test for interaction and see that in fact the intervention does have an effect on both sub-groups (one positive and one negative). We don’t get to test for interaction, because the rule was designed to keep the error rate at 5% when in fact there is no effect, main or otherwise.

Of course, things are not totally clear cut. If we are quite certain that the effects are going to be positive for both groups, the second approach is not such a disaster. In fact, if we suspect that one of the sub-group effects will be large, it may be preferable to go with this approach. (Look at the right-hand side of the bottom plot to see this.) But, it is still hard to argue (though please do if you feel so inclined), at least based on the assumptions I used in the simulation, that we should take any approach other than the global test.


text:
• Víc
Reklama

# Somewhere Right - text

Playlist
So what if we are projecting
Means to an ending
No harm if we just
Never admit this could be it
Better make our peace with that
Day or night
You know I'll always take you somewhere right
You know I'll always take you somewhere right
Somewhere right
You know I'll always take you somewhere right
Somewhere right
You know I'll always take you somewhere
Gold shining halos
I never figured I was ever one to die without means to make it back
Day or night
You know I'll always take you somewhere right
You know I'll always take you somewhere right
Somewhere right
You know I'll always take you somewhere right
Somewhere right
You know I'll always take you somewhere
I'll always take you somewhere
I'll always take you somewhere
Show me the end and I'll show you the start
Show me the end and I'll show you the start
Show me the end and I'll show you the start
Finally a place we can...
Show me the end and I'll show you the start
Show me the end and I'll show you the start
Show me the end and I'll show you the start
Finally a place we can start
Somewhere right
You know I'll always take you somewhere right
Darling day or night close your eyes
You know that I will always take you somewhere
Reklama

Reklama

## Mutemath texty

Tento web používá k poskytování služeb, personalizaci reklam a analýze návštěvnosti soubory cookie. Používáním tohoto webu s tím souhlasíte. Další informace.


text:
## Angular wavenumber

A very interesting thing I re-discovered today is the angular wavenumber. Although it seems like I had understood that pretty well long back, I had forgotten quite some things about it. The rumination came from my continuous learning process of Fourier Transform. While I seem to have gotten a hang of temporal Fourier transform, spacial … Continue reading Angular wavenumber

## My notes on Laplace transform

The Laplace transform of a function f(t), defined for all real numbers t ≥ 0, is the function F(s), which is a unilateral transform defined by: $latex F(s)=\int_{0}^{\infty} f(t)e^{-st} dt$ where s is a complex number frequency parameter $latex s=\sigma +i\omega$, with real numbers $latex \sigma$ and $latex \omega$. In the case of the Laplace transform, … Continue reading My notes on Laplace transform

## My notes on Hilbert transform

http://complextoreal.com/wp-content/uploads/2013/01/tcomplex.pdf Hilbert transform in frequency domain -It is a peculiar sort of filter that changes the phase of the spectral components depending on the sign of their frequency. -It only effects the phase of the signal. It has no effect on the amplitude at all.For any signal g(t), its Hilbert Transform has the following property: … Continue reading My notes on Hilbert transform

## Brief note on seismic migration and inversion

Seismic Inversion Essentially in this method, elastic properties of the geological subsurface are estimated. The method is carried out by minimizing the difference between simulated and recorded data. Hence, forward modeling is central in inversion & residual carried forth the iterative estimation process. Seismic Migration In this method, reflectivity of the geological boundaries is estimated … Continue reading Brief note on seismic migration and inversion

Disclaimer: The notes are made from information available here and wikipedia. Conjugate gradient is effective for solving systems of the form: $latex \mathbf{A}x=b$ $latex x$ is an unknown vector $latex \mathbf{A}$ is a known positive-definite, square, symmetric matrix $latex b$ is a known vector The CG method is most effective in solving systems where $latex \mathbf{A}$ is … Continue reading Conjugate gradient method


text:
# Tag Info

0

First this is not a full answer, but it might help you. You probably hit $B$ quickly with $(1)$ than with $(2)$. Hint of previous assertion I might reformulate your question. I suppose your pricing condition is $$\left\langle X^{(2)}\right\rangle_t=\left\langle X^{(1)}\right\rangle_t$$ so you get : $$X^{(1)}_t = ... 3 Using https://en.wikipedia.org/wiki/Ornstein%E2%80%93Uhlenbeck_process#Solution$$X^i_t = (X^i_0 + \int_0^t\sigma_i e^{a_i u} dB^i_u)e^{-a_it} $$and$$ X^i_t-\mathbb{E}[X^i_t] = e^{-a_it} \int_0^t\sigma_i e^{a_i u} dB^i_u $$and thus :$$\text{Cov}(X^1_t,X^2_t)=\mathbb{E}\left[e^{-a_1t} \int_0^t\sigma_1 e^{a_1 u} dB^1_u e^{-a_2t} \int_0^t\sigma_2 ...

0

I dont know what exactly you want but have a look at : http://www.sitmo.com/article/calibrating-the-ornstein-uhlenbeck-model/ you calibrate the first one in stand alone, then the second one in stand alone, endly you can compute correlation on the residuals of the increments knowing your parameters

1

let define $$\text{RP}_t = \sum_{u< t} \frac{dP_u}{P_u}$$ $$\text{RQ}_t =\sum_{u<t} \frac{dP_u}{P_u}$$ $X$ is a mean reverting process so : $$dX = \alpha (\mu - X)dt + \sigma dB$$ where $B$ is a brownian motion meanwhile using your relationship you get : $$X_t = \text{RP}_t - b \text{RQ}_t - a t$$ you use $X$ dynamics with this and you get: ...

Top 50 recent answers are included


text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# Attosecond electron–spin dynamics in Xe 4d photoionization

## Abstract

The photoionization of xenon atoms in the 70–100 eV range reveals several fascinating physical phenomena such as a giant resonance induced by the dynamic rearrangement of the electron cloud after photon absorption, an anomalous branching ratio between intermediate Xe+ states separated by the spin-orbit interaction and multiple Auger decay processes. These phenomena have been studied in the past, using in particular synchrotron radiation, but without access to real-time dynamics. Here, we study the dynamics of Xe 4d photoionization on its natural time scale combining attosecond interferometry and coincidence spectroscopy. A time-frequency analysis of the involved transitions allows us to identify two interfering ionization mechanisms: the broad giant dipole resonance with a fast decay time less than 50 as, and a narrow resonance at threshold induced by spin-flip transitions, with much longer decay times of several hundred as. Our results provide insight into the complex electron-spin dynamics of photo-induced phenomena.

## Introduction

The absorption of X-rays by matter has been used since more than a century ago to understand the structure of its fundamental constituents1. An X-ray photon absorbed by an atom triggers multiple electron dynamics. The emission of an electron from an inner shell is accompanied by ultrafast rearrangement of the electronic cloud, which simultaneously modifies the potential seen by the electron, sometimes leading to resonances in the emission spectrum. An outer-shell electron may fill an inner hole, while another electron is emitted, a process called Auger decay2. Finally, the electron spin may be affected by the magnetic field induced by the ultrafast orbital motion, giving rise to spin flip, which is forbidden for purely electric dipole transitions. All of this complex hole or electron motion occurs on a rapid time scale, in the attosecond (1 as = 10−18 s) range.

The interaction of xenon atoms with photons in the 70–100 eV range illustrates many aspects of the electron dynamics sketched above. Collective many-electron effects in the 4d shell3,4,5,6 lead to a broad “giant dipole” resonance in the photoionization cross-section, which is maximum at 100 eV7,8. Photoionization is accompanied by Auger decay, involving the 5s and 5p shells, leading to the formation of Xe2+ ions9 (see Fig. 1). Relativistic (spin-orbit) effects can be observed at threshold (in the 70–75 eV region), with, in particular, an anomalous branching ratio between the 2D5/2 and 2D3/2 final states of the ion, separated by a spin-orbit splitting of 2 eV10,11,12.

Attosecond pulses produced by high-order harmonic generation in gases13,14 enable measuring ultrafast electron dynamics, as shown in a series of seminal experiments15,16,17,18,19,20,21,22. Temporal information is obtained by pump/probe techniques combining attosecond pulses and a synchronized laser field. The reconstruction of attosecond beating by interference of two-photon transition (RABBIT) technique23, based on interferometry, allows the determination of the photoionization spectral amplitude in the complex plane. The temporal dynamics is then obtained by Fourier transform or more generally by time-frequency analysis16,24. This technique has been successfully used to measure photoionization time delays, due to electron propagation in the potential following the absorption of an extreme ultraviolet (XUV) photon. Most of these studies25,26,27,28, however, have concentrated on relatively simple systems, ionized from the valence shells.

In this work, we present measurements of photoionization time delays in the Xe 4d shell for different ionic states 4d−1(2D5/2) and 4d−1(2D3/2), denoted 4d5/2 and 4d3/2 in the following (see Fig. 1b). Auger-photoelectron coincidence spectroscopy is used to disentangle electrons from different photoionization and decay channels29. The RABBIT interferometric technique allows the extraction of a phase, or a time (or group) delay, from the photoelectron spectra. At high photon energy (between 80 and 100 eV), both 4d5/2 and 4d3/2 photoelectrons are emitted with the same positive time delay. Close to the 4d-ionization threshold (75–80 eV), the measured time delays differ by more than 100 as. Supported by relativistic random phase approximation (RRPA) theoretical calculations30, we show that this difference is due to the interference of the broad giant dipole resonance with a narrow threshold resonance due to relativistic spin-orbit effects.

## Results

The experiments were performed with attosecond pulse trains generated in neon by a femtosecond Ti:sapphire laser system, covering a spectral range from the 4d ionization threshold to the maximum of the giant dipole resonance (see Methods for details). A small fraction of the infrared (IR) laser beam was used as a probe with a variable time delay. The XUV and IR pulses were focused into Xe gas and the created electrons were detected by an electron spectrometer.

Photoionization to different ionic states followed by Auger decay produces a complex electron spectrum, with two sets of photoelectrons separated by 2 eV (see Fig. 1). Single Auger decay from Xe+ (e.g., 4d5/2) to Xe2+ (e.g., 5s−15p−1) leads to electrons at kinetic energies equal to the difference between intermediate and final state energies, spanning from 8.3 eV to 36.4 eV31 and thus overlapping with the photoelectrons ionized by 75–100 eV photons32. Figure 2 shows XUV-only (a) and XUV+IR (b) two-dimensional coincidence maps. For a given final state of Xe2+, Auger electrons detected in coincidence with photoelectrons contribute to a stripe with discrete spots related to absorption of different harmonics (with odd orders 53 to 63 in the figure), or absorption of harmonics and absorption or emission of an IR photon (sidebands 54 to 62). In addition, weak signals due to absorption or emission of an IR photon by the Auger electron, are observed (see, e.g., the difference between the blue and red curves in Fig. 2e at 9.8 eV). This coincidence technique requires long acquisition times, but allows us to disentangle unambiguously the 4d5/2 and 4d3/2 photoelectrons by the energy of the Auger electron.

Each sideband arises from the interference between two quantum paths as illustrated at the top of Fig. 2(d). The sideband signal oscillates as a function of the delay τ between the attosecond pulse train and the probe IR field, according to,

$${I}_{{\rm{SB}}}=A+B\cos (2\omega \tau -\phi ),$$
(1)

where A and B are constants, ω is the IR frequency and ϕ is a phase offset, which can be extracted by fitting with a cosine function. The phase offset ϕ divided by the oscillation frequency (2ω) can be written as the sum of two delays, τXUV + τA. The first one is the group delay of the attosecond pulses, while the second, called atomic time delay, arises from the two-photon ionization process. As shown in previous work33,34 and as discussed in more details in the Supplementary Fig. 1, the variation of the atomic time delay τA, as a function of XUV photon energy or between two spin-orbit split final states, reflects, to a large extent, one-photon ionization dynamics. To remove the influence of τXUV in our time delay measurements, we alternate experiments in Xe and Ne, and measure the time delay difference. Atomic time delays in Ne 2p can be measured and calculated with good accuracy. They are very small in the energy range considered33, so that the time delay differences between Xe and Ne are, to a very good approximation, absolute time delays in Xe (see Supplementary Fig. 2). The sidebands corresponding to the same photoelectron but different Auger final state are found to oscillate in phase within our error bar, which allows us to average the time delays over the different Auger decay channels.

Figure 3 presents the absolute atomic delays for 4d5/2 (a) and 4d3/2 (b) as a function of photon energy. We also present theoretical calculations obtained by solving the Dirac equation in RRPA (see Methods). At high photon energy (>80 eV), both 4d5/2 and 4d3/2 exhibit very similar positive time delay, about 40 as at 80 eV, slightly decreasing with energy. At low photon energy (<80 eV), the delays show a rapid variation with energy, opposite for the two final states. Theory and experiment are in good agreement at high photon energy. Although the agreement in the threshold region is not as good, the main features of the experiment are reproduced. Our theoretical calculations are in excellent agreement with the predictions of Mandal and coworkers35,36.

Figure 3c shows the difference between 4d3/2 and 4d5/2 time delays. This difference is close to zero at high energy but jumps to more than 100 as at 75 eV. Unfortunately, we could not reliably extract time delays below 75 eV, due to the low cross section and the overlap with double Auger electrons below 5 eV kinetic energy. The RRPA calculation predicts a strong decrease of the time delay difference towards the threshold. It also shows a strong deviation of the branching ratio between 4d5/2 and 4d3/2 cross sections from the statistical prediction in the same energy range, reproducing well experimental results37,38 (see Fig. 3d).

## Discussion

To understand the underlying physics behind the variation of the time delays, we examine the behavior of the RRPA transition matrix elements involved in Xe 4d single photon ionization. In the energy range considered in this work, photoionization is dominated by the transitions from the 4d shell to continuum f states, which we denote 4d → ϵf in the following. The contribution from 4d → ϵp transitions is one order of magnitude smaller in this energy region, as shown in the Supplementary Fig. 3. The asymptotic phase for a given channel is the sum of the Coulomb phase and a phase due to the short-range potential. The Coulomb phase is removed in the phases displayed in Fig. 4, as well as in the calculation of the time delays, in order to focus on the short range effects (see Supplementary Fig. 1). Figure 4a shows that photoionization is dominated by 4d3/2 → ϵf5/2 and 4d5/2 → ϵf7/2, especially at high photon energy, in the region of the giant dipole resonance. In the threshold region, the 4d5/2 → ϵf5/2 channel contributes significantly. This transition is accompanied by a spin flip, which points out the role of the spin-orbit interaction. The phases and time delays for the three channels (Fig. 4b,c) coincide above 80 eV photon energy, showing the first half of a π phase variation across the giant dipole resonance with a time delay of  ~40 as. Below 80 eV, the three quantities plotted in Fig. 4a–c show a strong, oscillating, channel dependence, indicating a quantum interference phenomenon.

The dynamics behind this effect can be unraveled by calculating the Wigner representation24,39, defined as the Fourier transform of the auto-correlation function of the transition matrix elements, Di(E), i denoting the channel, and E the electron kinetic energy.

$$W(E,t)=\frac{1}{2\pi }\int_{-\infty }^{\infty }d\epsilon {D}_{i}\left(E+\frac{\epsilon }{2}\right){D}_{i}^{* }\left(E-\frac{\epsilon }{2}\right){e}^{-\frac{i\epsilon t}{\hslash }},$$
(2)

where is the reduced Planck constant. The results are shown in Fig. 5a for the 4d5/2 → ϵf5/2 channel (see Supplementary Fig. 4, for the other two channels). All three channels show similar features. (i) A broad resonance with a maximum around 100 eV and a short decay of a few tens of attosecond, which can be interpreted as the giant dipole resonance; (ii) A sharp resonance at low energy, around 75 eV, with a long decay of a few hundreds of attoseconds; (iii) Interferences between these resonances, leading to rapid oscillations of the Wigner distribution.

To interpret the sharp spectral feature at 75 eV, we utilize the theoretical analysis performed in the seminal work of Cheng and Johnson12. Using a multichannel quantum defect theory approach40, results obtained within RRPA, similar to those of the present work, were analyzed and eigenchannel solutions were extracted. These eigenchannel solutions are completely decoupled from each other and can be used as a basis to describe coupled-channel transitions. They are labeled using the closest corresponding LS-coupled channel [(d9f) and (d9p)1P, 3P, 3D], where in all these cases it is only the J = 1 states that can be populated from the xenon ground state by one-photon absorption. Neglecting the weak contribution of the 4d → ϵp transitions, the 4d → ϵf transitions are superpositions of (d9f) 1P, 3P and 3D eigenchannels (In the following, we drop the d9f label).

Figure 4d–f present the modulus, phase and time delay of these three eigenchannels. The behavior of the three curves is much simpler than those in Fig. 4a–c. For each eigenchannel, a single resonance feature can be identified, with a peak for the modulus and time delay and a π phase variation across the resonance. While the broad feature, maximum at 100 eV, obviously represents the giant dipole resonance (1S → 1P), the narrow peaks at 75 and 76 eV exist because of the spin-orbit interaction that enables singlet to triplet mixing. The maximum of the time delay varies from a few tens (1P) to a few hundreds (3D and 3P) of attoseconds, in agreement with the results in Fig. 5a.

The difference in time delays can be further interpreted by examining the effective potential experienced by the escaping f photoelectron. We represent in Fig. 5b a mean-field average potential (red), as well as the potential modified by 1S → 1P dipole polarization (screening) effects (black), which are included in the random phase approximation with exchange (RPAE) approach. These effects lead to an effective high and narrow potential barrier and therefore to a broad resonance, with a maximum at high energy, and a short decay time (see black dashed line). In contrast, an electron emitted in the triplet channels does not feel these dipole polarization effects and sees essentially the potential indicated in red, with a relatively low barrier only due to angular momentum and a long decay time (red dashed line). The time delay is directly related to the resonance lifetime, being equal to it at the maximum of the resonance41. Figure 5b even suggests that the increase of the temporal width of the broad resonance in Fig. 5a towards low energy might be due to the influence of the long tail of the screened potential (black).

The rapid variation of the amplitude, phase and delays of the three 4d → ϵf channels (Fig. 4a–c) at threshold can therefore be interpreted as a quantum interference effect between the “direct” dipole-allowed 1S → 1P transition and the spin-orbit-induced 1S → 3P, 3D transitions, which have similar amplitudes in this region. This interference explains the difference in time delays for 4d3/2 and 4d5/2, as well as the anomalous branching ratio (Fig. 3c, d).

In conclusion, we have measured photoionization time delays in Xe using attosecond interferometry, giving us high temporal resolution, and coincidence spectroscopy, which allows us to avoid spectral congestion and to obtain a high spectral resolution. These time delays are positive and similar for the two spin-orbit split Xe+ states over a large energy range (up to 100 eV photon energy), except at threshold (75 eV) where they differ by 100 as. With the help of RRPA calculations for one- and two-photon ionization, we attribute this difference to the interference of several channels coupled by the spin-orbit interaction. A time-frequency analysis of the dominant transition matrix elements, allows us to unravel two main ionization processes, with very different time and energy scales: the broad giant dipole resonance, dominated by the 1S to 1P transition and the narrow resonances due to the 1S to 3P and 3D transitions, which are enabled by the spin-orbit interaction. While the former takes place over a few tens of attoseconds, the latter, involving spin flip, occurs over several hundreds of attoseconds. Our experimental approach, which adds temporal information to traditional spectral studies, provides increased understanding of the complex electron dynamics taking place in Xe 4d photoionization. Finally, shape resonances are ubiquitous in nature and the methods developed in this work should be useful to investigate the electronic properties of a variety of molecular systems (see recent work in N242 and CH3I43).

## Methods

### Experimental method

The experiments were performed with 40-fs long pulses, centered at 800 nm with 1-kHz repetition rate from a Ti:sapphire femtosecond laser system. The laser was focused into a 6-mm long gas cell filled with Ne to generate high-order harmonics. A 200-nm thick Zr filter was used to filter out the infrared (IR) and most of the harmonics below the Xe 4d threshold (67.5 eV for 4d5/2). The filtered harmonics thus span the 4d ionization region from the threshold to the maximum of the giant dipole resonance (100 eV). A small fraction (30%) of the IR beam, split-off before generation, is used as a probe with a variable time delay. The XUV and IR pulses were focused in an effusive Xe gas jet. The electrons were detected by a magnetic bottle electron spectrometer, which combines high collection efficiency and high spectral resolution up to E/ΔE ~ 80.

### Data analysis

Each data point in Fig. 3 is the arithmetic mean weighted with the uncertainty estimated from the cosine fitting to Eq. (1). In each measurement, we average the time delays of electron pairs corresponding to the same photoelectron but different Auger decay. For N measurements yielding N data points: τ1τ2, …, τN with corresponding uncertainties: σ1σ2, …, σN, the weighted average can be calculated as:

$$\overline{\tau }=\frac{\mathop{\sum }\nolimits_{i = 1}^{N}{w}_{i}{\tau }_{i}}{\mathop{\sum }\nolimits_{i = 1}^{N}{w}_{i}},$$
(3)

where $${w}_{i}=1/{\sigma }_{i}^{2}$$ is the weight. The uncertainty for each measurement is estimated from the fit of the RABBIT oscillation to a cosine function. The uncertainty on the time delay difference, τA − τB, can be expressed as:

$$\sigma =\sqrt{{\sigma }_{A}^{2}+{\sigma }_{B}^{2}}.$$
(4)

The error bars of the experimental results indicate the standard error of the weighted mean and can be calculated as:

$${\sigma }_{\overline{\tau }}=\sqrt{\frac{N}{(N-1){\omega }_{{\rm{s}}}^{2}}\sum {\omega }_{i}^{2}{({\tau }_{i}-\overline{\tau })}^{2}},$$
(5)

where ωs = ∑ωi.

### Theoretical method

Theoretical calculations consisted in calculating one-photon and two-photon matrix elements within lowest-order perturbation theory for the radiation fields, using wavefunctions obtained by solving the Dirac equation, and including electron correlation effects within the RPAE for one-photon XUV photoionizaton.

The complex-valued two-photon matrix elements44,45 are calculated following the procedure described in46,47 for the non-relativistic case. Briefly, the absorption of one ionizing photon is treated within the RPAE approximation and a perturbed wave function is calculated. Exterior complex scaling is used in order to be able to use a finite numerical box. The two-photon matrix element is dominated by a one-photon dipole matrix element between the intermediate perturbed wave function and the final continuum state48. The integration is performed numerically out to a distance far outside the atomic core, but within the unscaled region, while the last part of the integral is carried out using analytical Coulomb waves along the imaginary radial axis. The amplitude and phase shift of these Coulomb waves are determined from the numerical solutions for the perturbed wave function and for the final state describing a free electron within the potential of the remaining ion. The numerical stability is monitored by comparison of different “break points” between the numerical and analytical descriptions.

A few adjustments have to be made in the relativistic case: Relativistic RPAE is used to obtain the perturbed wave function after absorption of one photon and the Dirac Hamiltonian to determine the phase shift of the final state. The Coulomb solution for the large component approaches the non-relativistic solution in the asymptotic region, albeit with relativistically adjusted parameters. For a given energy, the small component is easily obtained from the large one30.

## Data availability

The data that support this study are available online https://doi.org/10.5878/rhak-nd96 at Swedish National Data Service. Source data are provided with this paper.

## Code availability

The codes used in this study are available from the corresponding author upon reasonable request.

## References

1. Schmidt, V. Photoionization of atoms using synchrotron radiation. Rep. Prog. Phys. 55, 1483–1659 (1992).

2. Howell, R. W. Auger processes in the 21st century. Int. J. Radiat. Bio. 84, 959–975 (2008).

3. Amusia, M. Y., Cherepkov, N. A. & Chernysheva, L. V. Cross section for the photoionization of noble-gas atoms with allowance for multielectron correlations. Zh. Eksp. Teor. Fiz. 60, 160–174 (1971).

4. Wendin, G. Collective resonance in the 4d10 shell in atomic Xe. Phys. Lett. A 37, 445–446 (1971).

5. Wendin, G. Collective effects in atomic photoabsorption spectra. III. Collective resonance in the 4d10 shell in Xe.J. Phys. B At. Mol. Phys. 6, 42–61 (1973).

6. Crljen, Z. & Wendin, G. Many-body theory of effective local potentials for electronic excitations. III. Phys. Rev. A 35, 1571–1581 (1987).

7. Lukirskii, A. P., Brytov, I. A. & Zimkina, T. M. Photoionization absorption of He, Kr, Xe, CH4, and methylal in the 23.6–250 Å region. Opt. Spectrosc. 17, 234–237 (1964).

8. Ederer, D. L. Photoionization of the 4d electrons in xenon. Phys. Rev. Lett. 13, 760–762 (1964).

9. Penent, F. et al. Multielectron spectroscopy: the xenon 4d hole double Auger decay. Phys. Rev. Lett. 95, 083002 (2005).

10. Amusia, M. Y., Chernysheva, L. V., Manson, S. T., Msezane, A. M. & Radojevic, V. Strong electron correlation in photoionization of spin-orbit doublets. Phys. Rev. Lett. 88, 093002 (2002).

11. SunilKumar, S., Banerjee, T., Deshmukh, P. C. & Manson, S. T. Spin-orbit-interaction activated interchannel coupling in dipole and quadrupole photoionization. Phys. Rev. A 79, 043401 (2009).

12. Cheng, K. T. & Johnson, W. R. Orbital collapse and the photoionization of the inner 4d shells for Xe-like ions. Phys. Rev. A 28, 2820–2828 (1983).

13. Paul, P. M. et al. Observation of a train of attosecond pulses from high harmonic generation. Science 292, 1689–1692 (2001).

14. Hentschel, M. et al. Attosecond metrology. Nature 414, 509–513 (2001).

15. Drescher, M. et al. Time-resolved atomic inner-shell spectroscopy. Nature 419, 803–807 (2002).

16. Gruson, V. et al. Attosecond dynamics through a Fano resonance: monitoring the birth of a photoelectron. Science 354, 734–738 (2016).

17. Itatani, J. et al. Tomographic imaging of molecular orbitals. Nature 432, 867–871 (2004).

18. Sansone, G. et al. Electron localization following attosecond molecular photoionization. Nature 465, 763–766 (2010).

19. Beaulieu, S. et al. Attosecond-resolved photoionization of chiral molecules. Science 358, 1288–1294 (2017).

20. Vos, J. et al. Orientation-dependent stereo Wigner time delay and electron localization in a small molecule. Science 360, 1326–1330 (2018).

21. Schultze, M. et al. Controlling dielectrics with the electric field of light. Nature 493, 75–78 (2013).

22. Tao, Z. et al. Direct time-domain observation of attosecond final-state lifetimes in photoemission from solids. Science 353, 62–67 (2016).

23. Muller, H. G. Reconstruction of attosecond harmonic beating by interference of two-photon transitions. Appl. Phys. B 74, S17–S21 (2002).

24. Busto, D. et al. Time-frequency representation of autoionization dynamics in helium. J. Phys. B Mol. Phys. 51, 044002 (2018).

25. Schultze, M. et al. Delay in photoemission. Science 328, 1658–1662 (2010).

26. Klünder, K. et al. Probing single-photon ionization on the attosecond time scale. Phys. Rev. Lett. 106, 143002 (2011).

27. Heuser, S. et al. Angular dependence of photoemission time delay in helium. Phys. Rev. A 94, 063409 (2016).

28. Cirelli, C. et al. Anisotropic photoemission time delays close to a Fano resonance. Nat. Commun. 9, 955 (2018).

29. Månsson, E. P. et al. Double ionization probed on the attosecond timescale. Nat. Phys. 10, 207–211 (2014).

30. Vinbladh, J. Two photon above threshold ionization in a relativistic framework: attosecond delays in high Z elements (Stockholm University, Stockholm, 2019).

31. Kivimäki, A., Pfeiffer, L., Aksela, H., Nõmmiste, E. & Aksela, S. Intensities of the xenon N4,5 OO Auger electron spectrum revisited. J. Electron Spectrosc. Relat. Phenom. 43, 101–103 (1999).

32. Jain, A., Gaumnitz, T., Bray, A., Kheifets, A. & Wörner, H. J. Photoionization delays in xenon using single-shot referencing in the collinear back-focusing geometry. Opt. Lett. 43, 4510–4513 (2018).

33. Isinger, M. et al. Photoionization in the time and frequency domain. Science 358, 893–896 (2017).

34. Dahlström, J. M. et al. Theory of attosecond delays in laser-assisted photoionization. Chem. Phys. 414, 53–64 (2013).

35. Mandal, A., Deshmukh, P. C., Kheifets, A. S., Dolmatov, V. K. & Manson, S. T. Angle-resolved Wigner time delay in atomic photoionization: the 4d subshell of free and confined Xe. Phys. Rev. A 96, 053407 (2017).

36. Mandal, A., Saha, S. & Deshmukh, P. C. In Quantum Collisions and Confinement of Atomic and Molecular Species, and Photons (Springer, Singapore, 2019).

37. Adam, M. Y. et al. Recent progress in the study of photoionization processes of atomic species by electron spectroscopy using synchrotron radiation. J. Electron Spectrosc. Relat. Phenom. 15, 211–224 (1979).

38. Shannon, S. P., Codling, K. & West, J. B. The absolute photoionization cross sections of the spin-orbit components of the xenon 4d electron from 70–130 eV. J. Phys. B Mol. Phys. 10, 825–830 (1977).

39. Wigner, E. P. On the quantum correction for thermodynamic equilibrium. Phys. Rev. 40, 749–759 (1932).

40. Lu, K. T. Spectroscopy and collision theory. The Xe absorption spectrum. Phys. Rev. A 4, 579–596 (1971).

41. Friedrich, H. Theoretical atomic physics (Springer-Verlag, Berlin, Heidelberg, 1998).

42. Nandi, S. et al. Attosecond timing of electron emission from a molecular shape resonance. Sci. Adv. 6, eaba7762 (2020).

43. Biswas, S. et al. Probing molecular environment through photoemission delays. Nat. Phys. 16, 778–783 (2020).

44. Kawai, S. & Bandrauk, A. D. Phase determination of harmonics by three-color photoionization of aligned molecules: The H$${}_{2}^{+}$$ system. Phys. Rev. A 75, 063402 (2007).

45. Dahlström, J. M., L’Huillier, A. & Maquet, A. Introduction to attosecond delays in photoionization. J. Phys. B Mol. Phys. 45, 183001 (2012).

46. Dahlström, J. M., Carette, T. & Lindroth, E. Diagrammatic approach to attosecond delays in photoionization. Phys. Rev. A 86, 061402(R) (2012).

47. Dahlström, J. M. & Lindroth, E. Study of attosecond delays using perturbation diagrams and exterior complex scaling. J. Phys. B Mol. Phys. 47, 124012 (2014).

48. Vinbladh, J., Dahlström, J. M. & Lindroth, E. Many-body calculations of two-photon, two-color matrix elements for attosecond delays. Phys. Rev. A 100, 043424 (2019).

## Acknowledgements

The authors acknowledge support from the Swedish Research Council, the European Research Council (advanced grant PALP-339253), the Knut and Alice Wallenberg Foundation and Olle Engkvist’s Foundation.

## Funding

Open Access funding provided by Lund University.

## Author information

Authors

### Contributions

S.Z., D.B., R.J.S., M.I., L.N., H.L., R.W. and C.L.A. performed the experiment. R.J.S. and R.F. provided part of the experimental setup. J.V., J.M.D. and E.L. performed RRPA calculations. S.Z., D.B., J.M.D., G.W., M.G., E.L. and A.L. worked on the analysis and the theoretical interpretation. S.Z. and A.L. wrote the main part of the manuscript. All authors gave feedback on the manuscript.

### Corresponding author

Correspondence to Shiyang Zhong.

## Ethics declarations

### Competing Interests

The authors declare no competing interests.

Peer review information Nature Communications thanks André Bandrauk, Niranjan Shivaram and the other, anonymous, reviewer(s) for their contribution to the peer review of this work. Peer reviewer reports are available.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Rights and permissions

Reprints and Permissions

Zhong, S., Vinbladh, J., Busto, D. et al. Attosecond electron–spin dynamics in Xe 4d photoionization. Nat Commun 11, 5042 (2020). https://doi.org/10.1038/s41467-020-18847-1

• Accepted:

• Published:

• DOI: https://doi.org/10.1038/s41467-020-18847-1


text:
# Physics:Enriched Xenon Observatory

Short description: Particle physics experiment

The Enriched Xenon Observatory (EXO) is a particle physics experiment searching for neutrinoless double beta decay of xenon-136 at WIPP near Carlsbad, New Mexico, U.S.

Neutrinoless double beta decay (0νββ) detection would prove the Majorana nature of neutrinos and impact the neutrino mass values and ordering. These are important open topics in particle physics.

EXO currently has a 200-kilogram xenon liquid time projection chamber (EXO-200) with R&D efforts on a ton-scale experiment (nEXO). Xenon double beta decay was detected and limits have been set for 0νββ.

## Overview

EXO measures the rate of neutrinoless decay events above the expected background of similar signals, to find or limit the double beta decay half-life, which relates to the effective neutrino mass using nuclear matrix elements. A limit on effective neutrino mass below 0.01 eV would determine the neutrino mass order. The effective neutrino mass is dependent on the lightest neutrino mass in such a way that that bound indicates the normal mass hierarchy.[1]

The expected rate of 0νββ events is very low, so background radiation is a significant problem. WIPP has 650 metres (2,130 ft) of rock overburden—equivalent to 1,600 metres (5,200 ft) of water—to screen incoming cosmic rays. Lead shielding and a cryostat also protect the setup. The neutrinoless decays would appear as narrow spike in the energy spectrum around the xenon Q-value (Qββ = 2457.8 keV), which is fairly high and above most gamma decays.

## EXO-200

### History

EXO-200 was designed with a goal of less than 40 events per year within two standard deviations of expected decay energy. This background was achieved by selecting and screening all materials for radiopurity. Originally the vessel was to be made of Teflon, but the final design of the vessel uses thin, ultra-pure copper.[2] EXO-200 was relocated from Stanford to WIPP in the summer of 2007.[3] Assembly and commissioning continued until the end of 2009 with data taking beginning in May 2011. Calibration was done using 228Th, 137Cs, and 60Co gamma sources.

### Design

The prototype EXO-200 uses a copper cylindrical time projection chamber filled with 150 kilograms (331 lb) of pure liquid xenon. Xenon is a scintillator, so decay particles produce prompt light which is detected by avalanche photodiodes, providing the event time. A large electric field drives ionization electrons to wires for collection. The time between the light and first collection determines the z coordinate of the event, while a grid of wires determines the radial and angular coordinates.

### Results

The background from earth radioactivity(Th/U) and 137Xe contamination led to ≈2×10−3 counts/(keV·kg·yr) in the detector. Energy resolution near Qββ of 1.53% was achieved.[4]

In August 2011, EXO-200 was the first experiment to observe double beta decay of 136Xe, with a half life of 2.11×1021 years.[5] This is the slowest directly observed process. An improved half life of 2.165 ±0.016(stat) ±0.059(sys) × 1021 years was published in 2014.[6] EXO set a limit on neutrinoless beta decay of 1.6×1025 years in 2012.[7] A revised analysis of run 2 data with 100 kg·yr exposure, reported in the June issue of Nature reduced the limits on half-life to 1.1×1025 yr, and mass to 450 meV.[4] This was used to confirm the power of the design and validate the proposed expansion.

Additional running for two years was taken.

EXO-200 has performed two scientific operations, Phase I (2011-2014) and after upgrades, Phase II (2016 - 2018) for a total exposure of 234.1 kg·yr. No evidence of neutrinoless double beta decay has been found in the combined Phase I and II data, giving the lower bound of $\displaystyle{ 3.5 \cdot 10^{25} }$ years for the half-life and upper mass of 239 meV.[8] Phase II was the final operation of EXO-200.

## nEXO

A ton-scale experiment, nEXO ("next EXO"), must overcome many backgrounds. The EXO collaboration is exploring many possibilities to do so, including barium tagging in liquid xenon. Any double beta decay event will leave behind a daughter barium ion, while backgrounds, such as radioactive impurities or neutrons, will not. Requiring a barium ion at the location of an event eliminates all backgrounds. Tagging of a single ion of barium has been demonstrated and progress has been made on a method for extracting ions out of the liquid xenon. A freezing probe method has been demonstrated, and gaseous tagging is also being developed.[9]

The 2014 EXO-200 paper indicated a 5000 kg TPC can improve the background by xenon self-shielding and better electronics. Diameter would be increased to 130 cm and a water tank would be added as shielding and muon veto. This is much larger than the attenuation length for gamma rays. Radiopure copper for nEXO has been completed. It is planned for installation in the SNOLAB "Cryopit".[10]:17[11]:7

An Oct. 2017 paper details the experiment and discusses the sensitivity and the discovery potential of nEXO for neutrinoless double beta decay.[12] Details on the ionization readout of the TPC have also been published.[13]

The pre-Conceptual Design Report (pCDR) for nEXO was published in 2018. The planned location is SNOLAB, Canada.

## References

1. See P. Vogel, A. Piepke (2007). "Neutrinoless Double-beta decay", in W.-M. Yao et al. (Particle Data Group) (2006). "Review of Particle Physics". Journal of Physics G 33 (1): 1–1232. doi:10.1088/0954-3899/33/1/001. Bibcode2006JPhG...33....1Y.
2. D. Leonard (2008). "Systematic study of trace radioactive impurities in candidate construction materials for EXO-200". Nuclear Instruments and Methods in Physics Research Section A 591 (3): 490–509. doi:10.1016/j.nima.2008.03.001. Bibcode2008NIMPA.591..490L.
3. "EXO project equipment successfully placed underground at WIPP" (PDF) (Press release). DOENews. 24 July 2007.
4. Albert, J. B.; Auty, D. J.; Barbeau, P. S.; Beauchamp, E.; Beck, D.; Belov, V.; Benitez-Medina, C.; Bonatt, J. et al. (12 June 2014). "Search for Majorana neutrinos with the first two years of EXO-200 data". Nature 510 (7504): 229–234. doi:10.1038/nature13432. PMID 24896189. Bibcode2014Natur.510..229T.
5. N. Ackerman (2011). "Observation of Two-Neutrino Double-Beta Decay in 136Xe with EXO-200". Physical Review Letters 107 (21): 212501. doi:10.1103/PhysRevLett.107.212501. PMID 22181874. Bibcode2011PhRvL.107u2501A.
6. Albert, J. B.; Auger, M.; Auty, D. J.; Barbeau, P. S.; Beauchamp, E.; Beck, D.; Belov, V.; Benitez-Medina, C. et al. (2014). "An improved measurement of the 2νββ half-life of Xe-136 with EXO-200". Phys. Rev. C 89 (1): 015502. doi:10.1103/PhysRevC.89.015502. Bibcode2014PhRvC..89a5502A.
7. M. Auger (2012). "Search for Neutrinoless Double-Beta Decay in 136Xe with EXO-200". Physical Review Letters 109 (3): 032505. doi:10.1103/PhysRevLett.109.032505. PMID 22861843. Bibcode2012PhRvL.109c2505A.
8. Anton, G. et al. (18 October 2019). "Search for Neutrinoless Double-$\ensuremath{\beta}$ Decay with the Complete EXO-200 Dataset". Physical Review Letters 123 (16): 161802. doi:10.1103/PhysRevLett.123.161802. PMID 31702371.
9. P. Fierlinger (2008). "A microfabricated sensor for thin dielectric layers". Review of Scientific Instruments 79 (4): 045101–045101–7. doi:10.1063/1.2906402. PMID 18447546. Bibcode2008RScI...79d5101F.
10. Yang, Liang (8 July 2016). "Status and Prospects for the EXO-200 and nEXO Experiments". XXVII International Conference on Neutrino Physics and Astrophysics. London.  Video available at Neutrino Conference 2016 - Friday (part 1) on YouTube.
11. MacLellan, Ryan (25 September 2017). "nEXO: a tonne-scale next-generation double-beta decay experiment". XV International Conference on Topics in Astroparticle and Underground Physics (TAUP 2017). Sudbury, Canada.
12. Albert, J. B. (2018). "Sensitivity and Discovery Potential of nEXO to Neutrinoless Double Beta Decay". Physical Review C 97 (6): 065503. doi:10.1103/PhysRevC.97.065503. Bibcode2018PhRvC..97f5503A.  LLNL-JRNL-737682
13. Jewell, M. (14 October 2017). "Characterization of an Ionization Readout Tile for nEXO". Journal of Instrumentation 13: P01006. doi:10.1088/1748-0221/13/01/P01006.


text:
# Operator Overview

The operators in DiffEqOperators.jl are instantiations of the AbstractSciMLOperator interface. This is documented in SciMLBase. Thus each of the operators have the functions and traits as defined for the operator interface. In addition, the DiffEqOperators.jl operators satisfy the following properties:

1. Derivative * Boundary gives a GhostDerivative operator, representing a derivative operator which respects boundary conditions
2. Boundary conditions generate extended vectors in a non-allocating form
3. Operators can be concretized into matrices

## Operator Compositions

Multiplying two DiffEqOperators will build a DiffEqOperatorComposition, while adding two DiffEqOperators will build a DiffEqOperatorCombination. Multiplying a DiffEqOperator by a scalar will produce a DiffEqScaledOperator. All will inherit the appropriate action.

### Efficiency of Composed Operator Actions

Composed operator actions utilize NNLib.jl in order to do cache-efficient convolution operations in higher-dimensional combinations.


text:
## The Definitive Guide To PHP’s isset And empty

Source: http://kunststube.net/isset/

PHP has two very similar functions that are essential to writing good PHP applications, but whose purpose and exact function is rarely well explained: isset and empty. The PHP manual itself doesn’t have a simple explanation that actually captures their essence and most posts written around the web seem to be missing some detail or other as well. This article attempts to fill that gap; and takes a broad sweep of related topics to do so.

To explain what these functions are needed for to begin with, it’s necessary to talk about PHP’s error reporting mechanism. PHP is an interpreted language that lacks a compilation step separate from the actual runtime.^1^ That is, you don’t typically compile PHP source code into an executable, then run that executable. PHP code is simply executed straight from the source and it either works or dies halfway through. The PHP interpreter and runtime can only complain about errors while the code is in full motion. Since there is no separate compilation step, certain types of errors that could be caught by a compiler can only surface at runtime.

There is now the dilemma between letting programs crash completely for every little mistake, or silently letting non-critical errors slip through. PHP is choosing the middle ground: it triggers an error, which by default simply causes a message to be output wherever it occurred. These errors can have different types, ranging from a relatively harmless E_NOTICE to a program-halting fatal E_ERROR. How these errors are handled can be customized. For example, their output can be turned off entirely or they can be redirected into a log file. They could also be turned into full-blown exceptions, which in turn can be handled by other error handling mechanisms.^2^

The PHP error reporting mechanism is vital in developing applications. What kind of errors should be triggered and whether they should be displayed or not can be configured in the php.ini file with theerror_reporting and display_errors directives, a setting that can also be changed during runtime. The error_reporting directive should be set to the highest possible value during development, but turned down or off on live production servers. Seeing errors as they are happening is important during development (unless one likes to take stabs into the dark). At the same time, errors in production can be a serious security leak (not to mention a nuisance) and must not be output for every visitor to see.

One of the things that triggers an error of the type E_NOTICE is the act of trying to use a variable that does not exist. This can happen due to simple typos or logic errors and error reporting helps to catch such errors quickly. But there’s also the legitimate case of simply not knowing whether a variable exists or not and needing to find out. If this legitimate case would trigger an error every time, it’d be impossible to efficiently tell real errors from non-critical errors. Which is where isset and empty come into play.

## Simple Definition

Here are the two functions defined in a nutshell:

bool isset( mixed $var [, mixed … ]) Returns true if the variable exists and is not null. Does not trigger an error if the variable does not exist. Example: $foo = 'bar';
var_dump(isset($foo)); -> true$baz = null;
var_dump(isset($baz)); -> false var_dump(isset($undefined));  -> false

bool empty( mixed $var ) Returns true if the variable does not exist or its value equals false in a loose comparison. Does not trigger an error if the variable does not exist. Example: $foo = 'bar';
var_dump(empty($foo)); -> false$baz = null;
var_dump(empty($baz)); -> true var_dump(empty($undefined));  -> true

The important and remarkable thing about this behavior is that when trying to pass non-existent variables to normal functions, an error is triggered. PHP first tries to get the value of the variable, then pass it into the function:

var_dump($foobar); -> Notice: Undefined variable: foobar NULL  isset and empty are not actually regular functions but language constructs. That means they’re part of the PHP language itself, do not play by the normal rules of functions and can hence get away with not triggering an error for non-existent variables. This is important when trying to figure out whether a variable exists or not. A typical case is trying to find out whether a certain value is present in the URL’s query part: if ($_GET['var'] == 'foo')

If $_GET[‘var’] actually exists, that is, if the URL contains ?var=foo, this will work just fine, regardless of the value of var. The presence or absence of$_GET[‘var’] is entirely in the hand of the user though. If the user does not include ?var=foo in the URL, this program will trigger an error.

To avoid this, we need to use isset:

if (isset($_GET['var']) &&$_GET['var'] == 'foo')

isset guards our naïve use of the non-existent variable. If it is not set, the code does not proceed to the actual comparison and no error is triggered. isset itself does not trigger an error. In a nutshell, isset performs a$var !== null check in a way that does not trigger an error. isset can accept multiple arguments and only returns true if all of them are set: if (isset($foo, $_GET['bar'],$array['baz'])) {
// all needed values exist, do something with them
}

### Null

When talking about isset one inevitably must also talk about null. Let’s come back for a second to the predicament of PHP trying to skip over trivial errors without crashing a program.

$foo =$_GET['var'];
$bar = 'bar'; if ($foo == $bar) { // do something }  How should PHP behave in the above program if$_GET[‘var’] did not exist? Sure, it will throw a tantrum and trigger a notice, and that’s good and fine. But how should it treat $foo afterwards? As some sort of special outcast that doesn’t have a value? Should it trigger an error every time$foo is used hence? The answer is simple: PHP assigns the value null in place of the non-existent variable. null is a type unto its own. nullis not a boolean, not an integer, not a string, not an object. null is of type null which can only have one value: null. null is used to mean the absence of a value, but null is just a regular value in itself. nullloosely compares to false (null == false, but null !== false).

PHP has a weird relationship to the value null. I am not clear about the historical development of it, but apparently it was exclusively supposed to be used for “non-existent” variables. Somehow it got promoted to a proper type of its own though. At the time of writing the manual even states:

Casting a variable to null will remove the variable and unset its value.

Unfortunately that’s not entirely correct. I may even go so far as to call it nonsense (which in fact I did in a bug report). Interestingly, the “cast” of a value to null is done with the syntax (unset)$var. There’s no(null)$var, like there is for all other primitive types. This kind of casting is also rather nonsensical. The following two expressions are equivalent:

$foo = (unset)$bar;
$foo = null;  Using the (unset) cast neither changes the value of$bar nor does it unset $bar. The only effect it has is the assignment of the value null to$foo. $foo is not unset in any way either, it continues to exist with the value null. To actually remove a variable, the function unset() needs to be used: unset($foo);

The $foo variable now indeed ceased to exist. Its value is gone, any further attempt to work with it will trigger an error: $foo = 'bar';
unset($foo); var_dump($foo);

This outputs:

Notice: Undefined variable: foo on line 3
NULL

PHP rightly complains that the variable $foo does not exist and the value of this non-existent variable is given as null. On the other hand: $foo = null;
var_dump($foo);  simply outputs: NULL  The value null is used as the default value if there is no value, but a variable that holds the value null is still a perfectly fine variable. PHP itself is somewhat schizophrenic about null and still has what I assume to be historical references to null having the same effect as unset and connotation of a variable not existing. This hopefully explains why isset is checking for null. This has the side effect of making it impossible to distinguish between a variable that does not exist and a variable that has the value null. ## Empty The empty construct doesn’t really have any caveats like isset does. It’s straight forward the same as$var == false, without triggering an error if the variable doesn’t exist. As the manual says, the following things are considered “empty”:

• ”“ (an empty string)
• 0 (0 as an integer)
• 0.0 (0 as a float)
• “0” (0 as a string)
• null
• false
• array() (an empty array)
• var $var; (a variable declared, but without a value in a class) And again, it really is simply the same as a loose comparison to false. That makes empty nothing more and nothing less than a convenient shortcut for !isset($var) || $var == false. It’s most often used in its negated form !empty($var), which is equivalent to isset($var) &&$var == true. It’s a great function to use if you expect a truthy value but are not sure if the variable exists at all:

if (empty($_GET['foo'])) { echo 'Error: please supply a valid value'; } if (!empty($array['foo'])) {
// array key exists and has a useful value, do something with it
}

if (!empty($foo) && is_array($foo)) {
// $foo exists and is a non-empty array, do something with it }  ## Function Return Values Something that may cause some irritation is the fact that you can’t use isset and empty with functions: isset(myFunction()) empty(myFunction()) -> Fatal error: Can't use function return value in write context  This would be a valid expression with any other function, like is_numeric(myFunction()), since it simply passes the return value of myFunction to the input of is_numeric. isset and empty are language constructs though and are meant to be used on variables only. Trying to test whether the output of a functionisset or is empty results in the above error. But it is never necessary to use the facilities of isset orempty for this purpose anyway. A function must exist, otherwise the program will crash with this message: Fatal error: Call to undefined function This is the type of error PHP does not silently forgive and forget. Furthermore, all functions always have a return value, at least an implicit return value of null (again, the value for “no value”). Hence, the following is the correct way of checking function return values: if (myFunction() !== null) -> equivalent of isset($var)

if (myFunction() == true)   -> equivalent of !empty($var) if (myFunction()) -> concise equivalent of !empty($var)

if (myFunction() == false)  -> equivalent of empty($var) if (!myFunction()) -> concise equivalent of empty($var)

To check whether a function exists, i.e. is declared, there’s function_exists.

Update: As of PHP 5.5 expressions are valid arguments for empty and isset. I.e. empty(foo() == ‘bar’) and such are working without error now. As explained above though, it hardly makes any sense to use it, because you’re just looking for a regular comparison operation which doesn’t require the special facilities ofisset or empty.

## Application

The correct place to use isset and empty is in one and only one situation: To test whether a variable that may or may not exist exists (isset) and optionally whether it’s also falsey (empty). The number one use case is with GET or POST values:

if (isset($_POST['username'],$_POST['password'])) {
// login form was submitted correctly,
// try to log the user in
}

Any external user input is entirely beyond the control of the programmer, hence these values may legitimately not exist and need to be treated as such. By the way, GET and POST values can never be null, isset’s behavior regarding null values is therefore of no concern.

If a variable should exist at some specific point in an application, the use of isset and empty is not recommended.

$foo = someComplicatedLogic(); if (empty($foo)) {
// someComplicatedLogic() returned something falsy
}

The above is a bad use of empty. It may seem very expressive, since it reads like “if $foo is empty…“, but this is foregoing the advantages of PHP’s error reporting. Consider this: $somePrettyLongVariableName = someComplicatedLogic();

if (empty($somePretyLongVariableName)) { // someComplicatedLogic() returned something falsy }  It’s very easy to waste half a day and a lot of hair on the above code, suspecting some logic error in thesomeComplicatedLogic() function, debugging everything line by line, wondering why oh why the code reports that someComplicatedLogic() returned something falsy when in fact everything seems to be working fine. This should have been written as: $somePrettyLongVariableName = someComplicatedLogic();

if (!$somePretyLongVariableName) { // someComplicatedLogic() returned something falsy }  The result would be the same, but here PHP would helpfully complain with Notice: Undefined variable: somePretyLongVariableName on line 3. The programmer would slap his forehead, fix the typo and move on with life. Which serves as a good summary for this whole article: • always develop with error reporting turned to 11 (and fix all real errors) • always use empty or isset for variables that may legitimately not exist • never use empty or isset for variables that should exist The point of PHP’s error reporting is to help the developer spot easy mistakes which other languages would complain about at compile time. The point of isset and empty is to specifically suppress Notice: Undefined variable errors when the programmer couldn’t otherwise avoid it. empty is a shortcut forisset + boolean comparison. And that’s the whole story. ## Epilog ### Edge Cases If a page requires that, say, the query parameter foo is supplied in the URL and all links to that page shouldinclude this parameter, I’d err on the side of not using isset or empty. There’s no way to make sure the parameter is set in the URL, but if the application is designed in a way that it should be set, it’s not incorrect behavior to trigger an error. It can help to quickly catch problems with invalid links during development and since error reporting will be silenced in production, it will not inconvenience any user. This is highly dependent on how errors are handled in the application and how the rest of the application flow goes though. // http://example.com/get_record.php?id=42$record = fetchRecordFromDatabase($_GET['id']); if (!$record) {
errorPage(404);
}

echo $record;  This very succinctly handles any form of invalid URL with a 404 page and even outputs helpful debug errors during development. Of course it makes some assumptions of how the examplefetchRecordFromDatabase and errorPage functions work. To handle the case of a non-existing$_GET[‘id’] separately would require a lot more code. Whether that’s necessary needs to be judged for every case individually.

### Array Keys

Specifically for arrays, there’s an alternative to isset($array[‘key’]) called array_key_exists. This function specifically does what it says: it returns true if an array key exists, regardless of the value of that key. That makes it possible to detect null values in arrays: $array = array('key' => null);

var_dump(isset($array['key'])); -> false var_dump(array_key_exists('key',$array));   -> true

This may be useful in some cases, but is in my opinion rarely necessary. null means “no value”. Variables are just the things that give the programmer a handle on values. A non-existent variable and no value are essentially the same thing, hence the behavior of isset should be sufficient in most cases. A legitimate exception is when you’re explictly working with language primitives, for example working on a JSON encoder that needs to translate the PHP null value into a ’null’ JSON value. Most business logic code though won’t need this.

### Initializing Variables

After all this talk about isset and empty, it’s time to mention that it’s really not necessary to use them often. Any proper application should initialize its variables, which makes checking for the existence of variables a rare occurrence.

#### Regular Code Blocks

Any logical block of code should initialize the variables it’s going to work on beforehand:

$foo = 'bar';$baz = null;

// do complicated things

There’s no need to check whether $foo or$baz exist after this point, because they do. This serves as self-documentation, makes sure variables always have a known default value and most of all helps to catch typos, because PHP can now properly complain about non-existent variables.

#### Functions

Any arguments defined in a function declaration exist as variables inside the function.

function foo($bar,$baz = null) { ... }

There’s no need to check whether $bar or$baz exist inside the function body, because they do. Even if no value was passed for the second $baz parameter, the variable$baz does in fact exist and has the default value null.

#### Arrays

Arrays can be initialized to hold default values easily using the array union operator + or array_merge:

function foo(array $options) {$options += array('bar' => true, 'baz' => false);
...
}

There’s no need to check whether \$options contains the keys ’bar’ or ’baz’, because it does. And they even have known, good default values.

1. To be exact, there are compilers for PHP, but by far the majority of PHP applications are not separately compiled.

2. Please note that errors are not exceptions. These are two independent error reporting mechanisms.


text:
# Functions of (AUB)

## Homework Statement

Let g be a function from ℝ to ℝ and for all subsets A and B of R.

## Homework Equations

Prove that:
$$g^{-1}(A\cup B)=g^{-1}(A)\cap g^{-1}(B)$$
and
$$g^{-1}(A\cap B)=g^{-1}(A)\cup g^{-1}(B)$$

## The Attempt at a Solution

Our teacher gave us this problem but I think it's wrong because I was easily able to prove that:
$$g^{-1}(A\cup B)=g^{-1}(A)\cup g^{-1}(B)$$
and
$$g^{-1}(A\cap B)=g^{-1}(A)\cap g^{-1}(B)$$
but when i try to solve what he gave us this is all I can do:

$$x\in g^{-1}(A\cup B)\Longleftrightarrow g(x)\in A\cup B\Longleftrightarrow g(x)\in Aorg(x)\in B\Longleftrightarrow x\in g^{-1}(A)\cup g^{-1}(B)$$

and the same goes for the second one. Can anyone tell me where I'm going wrong?

Related Calculus and Beyond Homework Help News on Phys.org
pasmith
Homework Helper

## Homework Statement

Let g be a function from ℝ to ℝ and for all subsets A and B of R.

## Homework Equations

Prove that:
$$g^{-1}(A\cup B)=g^{-1}(A)\cap g^{-1}(B)$$
and
$$g^{-1}(A\cap B)=g^{-1}(A)\cup g^{-1}(B)$$
These are wrong. A counterexample to both is the zero function $g(x) \equiv 0$ with $A = \{0\}$ and $B = \{1\}$.

## The Attempt at a Solution

Our teacher gave us this problem but I think it's wrong because I was easily able to prove that:
$$g^{-1}(A\cup B)=g^{-1}(A)\cup g^{-1}(B)$$
and
$$g^{-1}(A\cap B)=g^{-1}(A)\cap g^{-1}(B)$$
These are correct.


text:
# ZCMU—1403

## 1403: Arne Saknussemm

Time Limit: 1 Sec  Memory Limit: 128 MB
[Submit][Status][Web Board]

## Description

Following the account of Jules Verne, a scrambled message written by the middle age alchemist Arne Saknussemm, and deciphered by professor Lidenbrock, started the incredible travel to the center of the Earth. The scrambling procedure used by Arne is alike the procedure given below.

1. Take a non empty message M that contains letters from the English alphabet, digits, commas, dots, quotes (i.e. '), spaces and line breaks, and whose last character is different than space. For example, consider the following message whose translation reads "In Sneffels's crater descend brave traveler, and touch the center of the Earth".

 In Sneffels craterem descende audas viator, et terrestre centrum attinges.

2. Choose an integral number 0<K≤length(M) and add trailing spaces to M such that the length of the resulting message, say M', is the least multiple of K. For K=19 and the message above, where length(M)=74 (including the 8 spaces and the line break that M contains), two trailing spaces are added yielding the message M' with length(M')=76.

3. Replace all the spaces from M' by the character _ (underscore) ; replace all the line breaks from M' by \ (backslash), and then reverse the message. In our case:

4. Write the message that results from step 3 in a table with length(M')/K rows and K columns. The writing is column wise. For the given example, the message is written in a table with 76/19=4 rows and 19 columns as follows:

 _ e t m n e e t _ t \ u d s m t _ f S _ g t u e r r _ , a s a n e e a s f _ . n a r c t r t r i a _ e d r r l e n s i _ t _ s e e o v d e c _ e c e n I

5. The strings of characters that correspond to the rows of the table are the fragments of the scrambled message. The 4 fragments of Arne's message given in step 1 are:

 _etmneet_t\udsmt_fS .narctrtria_edrrlen _gtuerr_,asaneeasf_ si_t_seeovdec_ecenI

Write a program that deciphers non empty messages scrambled as described. The length of a message, before scrambling, is at most 1000 characters, including spaces and line breaks.

The program input is from a text file where each data set corresponds to a scrambled message. A data set starts with an integer n, that shows the number of fragments of the scrambled message, and continues with n strings of characters that designate the fragments, in the order they appear in the table from step 4 of the scrambling procedure. Input data are separated by white-spaces and terminate with an end of file.

## Output

The deciphered message must be printed on the standard output, from the beginning of a line and must be followed by an empty line as shown in the input/output sample below.

## Sample Input

4 _etmneet_t\udsmt_fS
_gtuerr_,asaneeasf_
.narctrtria_edrrlen
si_t_seeovdec_ecenI
11 e n r e V _ s e l u J

## Sample Output

In Sneffels craterem descende audas
viator, et terrestre centrum attinges.

Jules Verne

## 【分析】

【代码】
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
char a[1050][1050];
char s[2000000];
int main()
{
int n;
while (~scanf("%d",&n))
{
for (int i=0;i<n;i++) cin>>a[i];
int len=0;
int t=1;
for (int j=strlen(a[0])-1;j>=0;j--)
for (int i=n-1;i>=0;i--)
{
//	if (a[i][j]!='_') t=1;
if (t) s[len++]=a[i][j];
}
t=0;
for (int j=0;j<strlen(a[0]);j++)
for (int i=0;i<n;i++)
if (a[i][j]=='_') t++;
else goto out;
out:;
for (int i=0;i<len-t;i++)
if (s[i]=='_') printf(" ");
else
if (s[i]=='\\') printf("\n");
else
printf("%c",s[i]);
printf("\n\n");
}
return 0;
}

• 本文已收录于以下专栏：

举报原因： 您举报文章：ZCMU—1403 色情 政治 抄袭 广告 招聘 骂人 其他 (最多只允许输入30个字)


text:
# How would one prove that $\sqrt{n}$ is the largest divisor that needs to be checked to determine if $n$ is prime?

Prove the statement:

$\forall n \in \mathbb{N}$,$\forall m \in \{2, 3,...,floor(\sqrt{n})\}$, $m$ does not divide $n \implies n$ is prime

English: If you cannot find a natural divisor > 2 for $n \in \mathbb{N}$ less than (or equal to?) $\sqrt{n}$ then $n$ is prime.

The reason I say "or equal to?" in parentheses, is because I am unsure if that is necessary to translate the logical expression above. But it seems like if it is equal to $\sqrt{n}$ then $\sqrt{n}$ is a divisor, therefore $n$ is not prime. So I think it is safe just to say "less than."

After these line-breaks is the excess information on how I arrived here. I write it all because it helps me practice this kind of math and understand the problems.

I ask this because I am writing a program to check for primes. I got the idea that I do not need to check all the way to $n$ and someone at this website mentioned I need only check to $\sqrt{n}$ and I asked my discrete math instructor, he told me I only need to check to $floor(\sqrt(n))$ which means round down to the greatest integer less than $\sqrt{n}$

So he showed me how to prove:

$\forall n \in \mathbb{N}$, $\forall m \in \{2, 3,...,floor(\sqrt{n})\}$, if $m$ divides $n$ then $n$ is not prime.

The proof is very trivial, and since it still takes me longer than his patience to figure out precisely what the statement says, I later realize this is not what I wanted to prove. I want to prove my statement at the top of the question, that if $\lnot \exists m$ s.t. $m$ divides $n$, then $n$ must be prime.

-

Suppose $n$ is not prime, then $n=rs$ with $r,s>1; r\ge s$

Then $s^2\leq rs=n$.

So if $n$ is not prime it has a factor $s$ with $s\leq \sqrt n$.

And therefore if $n$ has no such factor, it must be prime.

-
So $s^2$ is less than or equal to $rs$ because $s \leq r$ –  Leonardo Jan 26 '13 at 9:34
I am still on line 3, all I see is that you took the square root of $s^2 = n$ but I still do not see how $s \leq \sqrt{n} \implies (r \land \lnot r)$ –  Leonardo Jan 26 '13 at 9:44
Suppose I have a number $n$ and I want to prove it is prime. I have to show that it it hasn't got a nontrivial factorisation. If it could be factorized, one of the factors would be less than or equal to the square root. So if I show that there is no such factor, I know there is no factorisation at all, and $n$ must be prime. –  Mark Bennet Jan 26 '13 at 10:08

If you write the natural number $n$ as the product of two natural number $a$ and $b$, then $a$ and $b$ cannot be both $> \sqrt{n}$.

-

If n is not prime, then we only need to prove n is a product of 2 factors, one of them prime-because trial dividing by primes is faster than trial dividing by all the natural numbers- but the other factor can be composite or prime.

-