text:
# BLOG: Heidelberg Laureate Forum

Laureates of mathematics and computer science meet the next generation

Thanks to the eponymous film, “the imitation game” is a phrase known by many people. I must confess though, before the talk by Avi Widgerson (Nevanlinna and Abel Prize recipient), on day two of the Heidelberg Laureate Forum, I wouldn’t have been able to tell you what an imitation game actually was. I might have mumbled something about computers, or even blurted out the words “Turing test”, but beyond that I would have been clueless. I learned over the course of that hour how imitation games are a tool with uses far beyond computing.

I shall begin as Widgerson did, and indeed as Turing himself did. With the Turing test.

### I’m not a robot

The Turing test was posed in Alan Turing’s 1950 paper “Computing Machinery and Intelligence”. Perhaps unsurprisingly, the name “Turing test” came about later. The name Turing gave his test was “the imitation game”, providing a small indication of what the test involves.

The purpose of the test is to determine whether or not a machine is able to exhibit intelligence. Put another way: can a robot think?

In the Turing test, a human referee interacts with an entity. The referee does not know whether the entity is itself human or not. At the end of the interaction, the referee must make a judgement as to the entity’s humanity. The robot entity is defined to be intelligent if a similar guess is made by every referee as it is in the case of a human entity.

Put more formally, consider a robot 🤖. Let $$p_0$$ be the probability that a referee judges a human entity to be human, and let $$p_1$$ be the probability that a referee judges the robot entity 🤖 to be human. The robot 🤖 is intelligent if for every human referee, $$p_0 \approx p_1$$.

At this point, I should say that if “intelligence” meant the same thing as it does in everyday parlance, then we would have to have a serious debate over whether or not humans are the right benchmark to be using. Intelligence here is defined as the ability to pass this test. That is precisely of the beauty of the test. It circumvents the philosophical debate over what it means to think, and focusses instead on the behavioural viewpoint.

The use of imitation games doesn’t stop at the Turing test though, and neither did Avi Widgerson’s talk. The imitation game can be treated as a framework and applied in many diverse scenarios.

In this paradigm, two things are considered to be the same if they cannot be distinguished by a reasonable test. It’s clear to see that this can have many different applications, and Widgerson introduced four of these in his lecture, from fields across mathematics and computer science.

### Lock and Key

It is not uncommon to hear conversations about encryption at the Heidelberg Laureate Forum. Indeed, we were treated to a panel on post-quantum cryptography on the Friday of the forum.

In discussing how we protect our messages, one facet that is often overlooked, though, is what it actually means for an encryption algorithm to be “secure”, and how we can message that.

The initial instinct is often to say that an algorithm is secure if it is impossible for anyone but the intended recipient to decrypt a message that was encrypted using that algorithm. But this begs the question, how do we know that it’s impossible? What if a decryption method exists but just hasn’t been found yet?

A good measure for how secure an encryption algorithm (let’s call it Enc) is, is whether or not two messages encrypted with it are distinguishable. If an encrypted message can’t be distinguished from random noise without the decryption key, it means that the encryption leaves no information about the initial message readable to the outside observer.

Now it’s time for another imitation game.

Instead of comparing a human and a robot, this imitation game compares two messages $$m_0$$ and $$m_1$$. We encrypt both of our messages using the encryption algorithm, Enc. Instead of a human judge, we have an “efficient algorithm” referee, who is tasked to determine whether the message it receives was originally $$m_0$$ or $$m_1$$.

Let $$p_0$$ be the probability that the referee judges Enc($$m_0$$) to be $$m_0$$, and let $$p_1$$ be the probability that the referee judges Enc($$m_1$$) to be $$m_0$$. The encryption is secure if for every efficient-algorithm referee $$p_0 \approx p_1$$.

Does this sound familiar? It should! This is analogous to the Turing test. We haven’t even scratched the surface of what imitation games can be used for though.

Security and privacy go hand in hand, so it’s perhaps unsurprising that Widgerson also discussed how imitation games can be used to assess privacy.

The specific situation Widgerson posed was the dilemma posed by databases. From data we’ve voluntarily given in surveys, to data submitted in censuses, to data that has been collected without us knowing, our data is stored in databases worldwide. In order for the data to be useful it needs to be detailed, but the more detailed it is, the more identifiable. A natural question arises: How can we verify that individuals can’t be identified from the data?

In their 2006 paper, Dwork, McSherry, Nissim and Smith proposed using an imitation game. We compare two databases $$D_0$$ and $$D_1$$, which are “adjacent”. This means that there is precisely one entry different, in this case $$D_0$$ includes Jane Doe, but $$D_1$$ does not . The referee in this case is any database query $$Q$$. A filter is applied to the databases and the filter is said to be differentially private if for every adjacent $$D_0$$ and $$D_1$$, and every legal query $$Q$$, $$p_0 \approx p_1$$.

Once again, the imitation game gives us a definition, based very much in the real world. In this instance, we get a definition of the word “private” and it’s a sensible one. If no query can detect that Jane Doe is in the database, then Jane has no need to worry. In a practical sense at least, the filter is private.

### “I’m so random”

You may have started to see the pattern by now, and I have one final example to share. This concerns randomness.

Randomness is much like artificial intelligence in that there are many philosophical debates as to whether it truly exists. Some argue that humans cannot simulate randomness (in fact, this was a discussion I had with some other members of the press at the Heidelberg Laureate Forum!). Putting human ability aside, many debate whether, say, a coin flip truly is random because the result is entirely determined by the initial conditions and the toss.

But beyond this debate, it’s important to consider how randomness can be simulated. Regardless of whether or not a coin toss is genuinely random, it’s just impractical to flip a coin every time you need a generate a random number. Suppose, then, that we want a pseudo-random source. What would this look like? How do we define “pseudo-random”? Is the stock market, or rainfall sufficiently random?

Once again, imitation games come to the rescue in answering these questions, in a method first suggested by Blum and Micali in 1981, and Yao in 1982.

We set up this imitation game with a random input, and our potential pseudo-random input. We give one of these inputs to an algorithm $$A$$ (our referee), which is tasked in determining which of the two inputs it is. As before, $$p_0$$ is the probability that the algorithm $$A$$ judges the random input correctly to be the random, and $$p_1$$ is the probability that the algorithm $$A$$ judges the potentially pseudo-random input to be the random input. The source is pseudo-random if for every algorithm referee $$p_0 \approx p_1$$.

### The examples are endless…

These STILL aren’t all the examples of imitation games that Avi Widgerson gave, but I shall stop here.

Throughout the course of his talk, Widgerson gave a whistle-stop tour of mathematics and computer science through imitation games. Turing was famously a polymath and it’s fitting that his idea is proving important across so much of science.

Avi Wigderson’s talk, as well as the entire scientific program of the 9th HLF, can be viewed on the HLFF YouTube channel.

### Posted by Sophie Maclean

Sophie Maclean is a mathematician and maths communicator based in London. She has previously worked as a Quantitative Trader and a Software Engineer, and now gives mathematics talks all over the UK (and Europe!) on a variety of topics. She is also a member of the team behind Chalkdust Magazine and always has a project on the go! You can follow her on Twitter at @sophiethemathmo.

1. Mathematically, the imitation game could be seen as a test of whether two unknown functions are the same, which means that the function value for any input is the same for both functions.

There is no explicit function description of the two functions and not even a table with function values. As a tester, you must take samples yourself and conclude that the functions are the same or not the same.

Problem: You can only perform a finite number of tests in a certain time, and if you do not find a difference between the two functions, it only means that you have not found a difference and not necessarily that there is no difference at all.

But in the end, this situation is very similar to our real life. For example, you can live with a partner and always think that the partner is a nice, lovable person – until the opposite is proven. And this realization that your partner is not a nice, lovable person can even come about after years of living together. Admittedly, maybe your partner has changed in the meantime or he has always been like that and you only found out very late.

• In etwa so, Herr “Holzherr” (die doppelten Anführungszeichen nur deswegen, weil ein als solches unerkennbares Pseudonym genutzt wird, Sie heißen nicht so!), insofern sollte sich aus diesseitiger Sicht im Sozialen nie um Gleichsetzung, dieser sog. Turing-Test versucht sich an ihr, versucht werden.

Die bekannte Online-Enzyklopädie kommt so :

Mit dem später sogenannten Turing-Test formulierte Alan Turing im Jahr 1950 eine Idee, wie man feststellen könnte, ob ein Computer, also eine Maschine, ein dem Menschen gleichwertiges Denkvermögen hätte. [Quelle]

Der Ansatz ist falsch, um einmal ein Füllwort zu nutzen, völlig falsch.

Korrekt wäre an Hand eines Kriterienkatalogs, der gesondert zu entwickeln wäre, einer unbekannten Entität i.p. Verständigkeit entgegen zu kommen.
Dabei insbesondere auch Interessen, Bedürfnissen und antizipierten Anforderungslagen dieser Entität vor- oder nachzuspüren.
Gerne auch, wenn es um “AI” geht, Peter Lustigs Rat zu folgen und abzuschalten.

Mit freundlichen Grüßen
Dr. Webbaer (der sich durchaus, also vollständig sozusagen, das Auftauchen einer künstlich geschaffenen “Intelligenz” auf diesem Planeten vorstellen kann, die ähnlich wie der sog. Gray Goo primär Vertilgungs-Tendenzen hätte – vielleicht verlautbarend, vielleicht einem sog. Turing-Test zur Genüge, aber doch mit einem unpässlichen Veranstaltungs-Charakter kommen könnte)

2. Sophie Maclean wrote (21. Oct 2022):
> The Turing test was posed in Alan Turing’s 1950 paper “Computing Machinery and Intelligence”. Perhaps unsurprisingly, the name “Turing test” came about later. The name Turing gave his test was “the imitation game” […]

Indeed.
(Incidentally, Turing’s paper doesn’t seem to mention “probability” related to those tests.. …)

> In the Turing test, a human referee interacts with an entity. The referee does not know whether the entity is itself human or not. At the end of the interaction, the referee must make a judgement as to the entity’s humanity.

Apparently this requires the referee to make a discrete (binary, Boolean) judgement:
Either the entity under test is judged “human”, or judged “not human”.
(Accordingly the referee is asked to “render a judgement”, rather than to “determine a score”.)

> Put more formally, consider a [one particular, fixed] robot […]
> Let $$p_0$$ be the probability that a referee judges a human entity to be human

Does this probability $$p_0$$ derive (as some average) from all (many) relevant referees having played out a suitably large number of tests with some (more or less representative) sample of distinct humans ?, or:

Does this probability derive (as some average) from one particular (fixed) referee (say referee $$R^k$$) having played out a suitably large number of tests with some (more or less representative) sample of distinct humans ?
(If so, this probability might be denoted more discriptively as $$p_0^k$$.)

> and let $$p_1$$ be the probability that a referee judges the robot entity to be human.

Does this probability $$p_1$$ derive (as some average) from all (many) relevant referees having played out one test each with the robot ?, or:

Does this probability $$p_1$$ derive (as some average) from all (many) relevant referees having played out a suitably large number of tests this same one robot,
allowing for the possibility that the same one referee came to different judgements in distinct iterations of the game ?, or:

Does this probability $$p_1$$ derive (as some average) from one particular (fixed) referee $$R^k$$ having played out a suitably large number of tests with the robot,
allowing for the possibility that referee $$R^k$$ came to different judgements in distinct iterations of the game ?
(If so, this probability might be denoted more discriptively as $$p_1^k$$.) Or:

Does the value $$p_1$$ represent the judgement of one particular (fixed) referee $$R^k$$ from one single tests with the robot ?
(If so, this value might be either exactly $$1$$, or else exactly $$0$$, for instance.)

Now, depending on the answers to the above questions, it should be possible to consider the subsequent conclusion …

> […] if for every […] referee, $$p_0 \approx p_1$$ [then …]

… in more detail. Perhaps especially relevant is the following case:

“If each referee $$R^k$$ finds $$p_0^k \approx p_1^k$$ then …”

It may then be asked and sorted out further whether some individual referee $$R^k$$ “is even qualified” (if, say, $$p_0^k \lt 0.5$$),
or whether some individual referee $$R^k$$ “can be trusted” (if, say, $$p_0^k \lt p_1^k$$ such that $$p_0^k \not\approx p_1^k$$) …

3. Dr. Webbaer fand den sog. Turing-Test, der Sacharbeit auf soziale Akzeptanz reduziert, kein anderer Versuch lag vor, nicht passend.
Vielleicht ist so nur vorgeschlagen worden, damit vorgeschlagen werden konnte.
Es gibt bei großen Denkern einige Beispiele dafür, Immanuel Kant hat bspw. den sog. Kategorischen Imperativ entwickelt, er passt ebenfalls nicht.
Und wer bei zeitgenössichen bundesdeutschen Denkern mal reinschaut, bspw. bei Peter Sloterdijk, wird auch nicht immer happy und sagt “So muss ich es haben, hier und jetzt, und zwar sofort!”, Precht und Jordan Peterson bleiben aus diesseitiger Sicht, um nur mal einige Namen zu nennen, “Namedropping” liegt vor, lol, auch nicht frei von dem Verdacht sozial angefordert sozusagen liefern zu müssen.

Mit freundlichen Grüßen
Dr. Webbaer (der der Ansicht ist, dass auf derartige “Tests” verzichtet werden darf bis muss)


text:
Completing the square!

1. Nov 28, 2004

enigmatatki

Hello =D I was doing an IB Project for math... and this question popped out.

Describe a method of writing the quadratic expression x2 + bx + c in the form
(x – h) 2 + g

I know how to do them (complete the square) but I don't know how to describe them.

for example, where does h and g pop out?

If you guys could help me... it would mean so much to me =D

thanx!!

2. Nov 28, 2004

Dr Transport

look at $$x^{2} + bx +(b/2)^{2} - (b/2)^{2} + c = (x+b/2)^{2} +c - (b/2)^{2}$$ which completes the square.....

3. Nov 29, 2004

Tide

You might be interested in the geometric interpretation - completing the square really IS completing the square!

(I had to do some serious editing and compression to get it to fit - hope it works!)

File size:
23.6 KB
Views:
55

format: plain


text:
# What does .shape[] do in “for i in range(Y.shape[0])” using Matplotlib?

MatplotlibServer Side ProgrammingProgramming

The shape property is usually used to get the current shape of an array, but it may also be used to reshape the array in-place by assigning a tuple of array dimensions to it.

## Steps

• Get an array Y using np.array method.

• Y.shape would return a tuple (4, ).

• Y.shape[0] method would return 4, i.e., the first element of the tuple.

## Example

import numpy as np

Y = np.array([1, 2, 3, 4])
print("Output of .show method would be: ", Y.shape, " for ", Y)
print("Output of .show[0] method would be: ", Y.shape[0], " for ", Y)
print("Output for i in range(Y.shape[0]): ", end=" ")
for i in range(Y.shape[0]):
print(Y[i], end=" ")

## Output

Output of .show method would be: (4,) for [1 2 3 4]
Output of .show[0] method would be: 4 for [1 2 3 4]
Output for i in range(Y.shape[0]): 1 2 3 4
Published on 17-Mar-2021 07:35:49


text:
# Gravitational waves from 3D MHD core-collapse supernova simulations with neutrino transport

Scheidegger, Simon Urs. Gravitational waves from 3D MHD core-collapse supernova simulations with neutrino transport. 2011, Doctoral Thesis, University of Basel, Faculty of Science.

 Preview

5Mb

Official URL: http://edoc.unibas.ch/diss/DissB_9392


text:
A Proofs

# Minimum number of input states required for quantum gate characterization

## Abstract

We derive an algebraic framework which identifies the minimal information required to assess how well a quantum device implements a desired quantum operation. Our approach is based on characterizing only the unitary part of an open system’s evolution. We show that a reduced set of input states is sufficient to estimate the average fidelity of a quantum gate, avoiding a sampling over the full Liouville space. Surprisingly, the minimal set consists of only two input states, independent of the Hilbert space dimension. The minimal set is, however, impractical for device characterization since one of the states is a totally mixed thermal state and extracting bounds for the average fidelity is impossible. We therefore present two further reduced sets of input states that allow, respectively, for numerical and analytical bounds on the average fidelity.

###### pacs:
03.65.Wj,03.67.Ac

present address: ]QSTAR, Largo Enrico Fermi 2, I-50125 Florence, Italy

## I Introduction

The usual measure to assess how well a quantum device implements a desired quantum operation is the average fidelity,

 Fav=∫\BraketΨO+D(\KetΨ\BraΨ)OΨdΨ, (1)

where denotes the desired unitary and the actual time evolution is described by the dynamical map . The standard approach to determine relies on quantum process tomography Nielsen and Chuang (2000). In practice, the average fidelity of a quantum process in a -dimensional Hilbert space is often estimated by performing quantum state tomography in a -dimensional Hilbert space. For qubits . The fidelity can also be obtained by determining the process matrix which is of size . In both cases quantum process tomography scales exponentially in resources Mohseni et al. (2008). For quantum devices to be realized and tested in practical applications, a less resource-intensive approach to characterization is required.

Recent attempts at reducing the required resources employ stochastic sampling of the input states and measurement observables Flammia and Liu (2011); da Silva et al. (2011); Shabani et al. (2011); Schmiegelow et al. (2011). The process matrix can be estimated efficiently if it is sparse in a known basis Mohseni and Rezakhani (2009); Shabani et al. (2011); Schmiegelow et al. (2011). For general unitary operations and without assuming any prior knowledge, Monte Carlo sampling to determine state fidelities in the -dimensional Hilbert space currently seems to be the most efficient approach Flammia and Liu (2011); da Silva et al. (2011); Steffen et al. (2012). This is due to the fact that the approach directly targets the fidelity between the desired operation and the implemented process rather than fully characterizing the process and subsequently comparing it to the desired operation. It also comes with the advantage of separable input states and local measurements. For qubits, this approach requires the ability to prepare input states since there are 6 eigenstates for the three Pauli operators for each qubit and the ability to measure all of the operators that form an orthonormal Hermitian operator basis.

Another approach to the estimation of the average fidelity exploits its property of being a second-degree polynomial in the states, utilizing a so-called two-design Bendersky et al. (2008). A commonly used two-design is made up of the states of mutually unbiased bases. The average fidelity is then written as a sum over state fidelities for these states Bendersky et al. (2008). The latter implies preparation of entangled input states since only three out of the mutually unbiased bases consist of separable states Lawrence (2011). Both Monte Carlo characterization and the two-design approach yield the average fidelity with an arbitrary, prespecified accuracy. Alternatively, bounds on the average fidelity can be obtained from two classical fidelities Hofmann (2005) where each classical fidelity is expressed as a sum over state fidelities. The different requirements of Monte Carlo characterization, the two-design approach and the two classical fidelities in terms of the number of input states raise the question of what is the minimal set of states to determine .

Here we show that a minimal set of states can be identified by the requirements to allow for distinguishing any two unitaries and assess whether the time evolution is unitary. We find the minimal set of states to consist of only two states, independent of the size of Hilbert space. The minimal set contains, however, a totally mixed thermal state which is impractical for experiments. We therefore also introduce a reduced sets of states that consist of the minimum number of pure states required to distinguish any two unitaries and assess whether the time evolution is unitary. The average fidelity can then be estimated by evaluating a distance measure for the reduced set of states. The corresponding protocol consists of preparing pure states, defined in -dimensional Hilbert space, and measuring the corresponding state fidelities. We show numerically that the estimate of the gate error differs from by less than a factor 2.5 in the worst case and on average by a factor 1.2. We furthermore demonstrate that evaluation of state fidelities for the reduced set of states is also sufficient to quantify the non-unitarity of the process. This allows to determine whether the gate error is due to decoherence or due to unitary errors that are easier to mitigate.

If analytical instead of numerical bounds on the average fidelity are desired, the reduced set needs to contain states, i.e., our approach generalizes the estimate of the average fidelity in terms of two classical fidelities Hofmann (2005). We show that the specific states utilized by Refs. Hofmann (2005); Lanyon et al. (2011) also fulfill the requirements for distinguishing any two unitaries and assessing unitarity of the time evolution – as do the states of any two mutually unbiased bases.

Our paper is organized as follows: The algebraic framework for identifying the minimum requirements to distinguish any two unitaries and assess unitarity of the time evolution is derived in Section II, introducing the concepts of commutant space and total rotation. Section III presents the reduced sets of states and discusses their use for extracting an estimate of the average fidelity. The relationship of our approach to the two classical fidelities of Ref. Hofmann (2005) is established in Section IV, and our results are summarized in Section V. Detailed proofs of the claims made in Section II are provided in Appendix A.

## Ii Algebraic framework: Commutant space and total rotation

To identify the reduced set of states, we introduce the concepts of commutant space of a set of density operators and total rotation. We assume purely coherent time evolution with an unknown unitary , such that , and generalize later to non-unitary time evolution. Since the evolution is insensitive to a global phase, is an element of the projective unitary group, , i.e., the quotient of the unitary groups and . Given a set of states, , we consider the map , mapping the unitary onto the set of time-evolved states, . We can differentiate any two unitaries , if and only if the map is injective. We show that is injective if the commutant space of the set has only one element, the identity.

We define the commutant space of a single density operator as the set of all linear operators in that commute with . It contains the identity and all operators that have a common eigenbasis with . Unitaries in the commutant space of cannot be distinguished from by time-evolving since . Therefore, to distinguish a unitary from the identity, the time evolution of at least two density operators with different eigenbases is required. Once we can differentiate an arbitrary unitary from the identity, we can differentiate it from any other unitary (and is injective). This follows from the fact that is a group. We define the commutant space of a set of density operators, , as the intersection of all , i.e., the set of all linear operators that commute with each . Suppose the identity is the only element of the commutant space . Then the identity is the only time evolution that leaves all unchanged and we can distinguish the identity from all other time evolutions by inspecting the time-evolved states. The detailed proof that injectivity of is equivalent to having identity as its only element is given in Appendix A.

In order to determine the states of the reduced set that have a commutant space with identity as its only element, we introduce the concept of total rotation. Unitary evolution corresponds to rotations in Hilbert space. Spanning the Hilbert space by an arbitrary complete orthornomal basis , a complete set of one-dimensional orthonormal projectors is obtained, . We construct density operators within this basis, for example by choosing a single state, with for , or a set of states, , , . The time-evolved basis state or states allow for distinguishing all those unitaries from identity that do not have common eigenspaces with all . To distinguish the remaining unitaries from identity, we construct one additional state, , that is guaranteed to have no common eigenspace with any . This is achieved by introducing a totally rotated one-dimensional projector obeying and taking . Adding to makes the set of projectors complete and totally rotating, . A set of states is complete and totally rotating if the subset of the projectors onto the one-dimensional eigenspaces of the is complete and totally rotating. For example, or . We show in Appendix A that the identity is the only projective unitary operator that has a common eigenbasis with all elements of such a set of states.

We have thus constructed a reduced set of states that allows for differentiating any two unitaries by inspection of the time-evolved states, . For coherent time evolution, we can evaluate

 Fj=Tr[ρOjρj(T)], (2)

which matches each state , subjected to the ideal operation, , to the actually evolved state, , for all . A suitable combination of the resulting yields an estimate of . However, for a possibly incoherent time evolution, we need to quantify the ’non-unitarity’ of the actual evolutions . This can be done by checking whether maps projectors onto projectors, reflecting rotations in Hilbert space. We show in Appendix A that indeed unitarity of a dynamical map is equivalent to mapping (i) a set of one-dimensional orthogonal projectors onto another such set of one-dimensional orthogonal projectors and (ii) a projector that is totally rotated with respect to the set onto a one-dimensional projector.

## Iii Reduced set of states yielding numerical bounds on the average fidelity

A set of density operators that allows for both differentiating any two unitaries and measuring the non-unitarity of any dynamical map is thus given by

 ρB,i = |φi⟩⟨φi|,i=1,…,d, (3a) ρTR = 1dd∑i,j=1|φi⟩⟨φj|. (3b)

By construction, the states , are pure. They are separable if a separable basis is chosen, i.e., if all are separable. Another suitable reduced set to differentiate any two unitaries and measure non-unitarity of is given by

 {ρB=∑iλiPi,ρTR}withλi≠λjfori≠j. (4)

This is the minimal set 1. However, for the characterization of quantum gates, it is preferable to use the pure input states defined in Eq. (3). Each of these states, when evolved in time, is characterized, to leading order, by real parameters. Knowledge of the total parameters is sufficient to determine whether the time evolution matches the desired unitary.

Note that both reduced sets are also sufficient to reconstruct a unitary that is close to a given open system evolution. This implies that, in optimal control calculations for quantum gates in the presence of decoherence, propagation of two states, independent of the system size , is sufficient. This reduces significantly the numerical effort compared to the states used to date Kallush and Kosloff (2006).

### iii.1 Estimating the gate error

The usual figure of merit in quantum process tomography, the average fidelity, , or, respectively, the gate error, , can be estimated by averaging over the distance measures , Eq. (2), for each state in the reduced set. Each becomes maximal if and only if . Our protocol thus consists in the preparation of states , Eq. (3), and measurement of the corresponding state fidelities, , for the time-evolved states, . A possible choice of states is e.g.

 (ρOB,i)nm≡(Pi)nm=δniδmi (5)

in the computational basis. The average over the can employ the arithmetic mean or a modified geometric mean,

 Farithunitary = 1d+1[d∑i=1FB,i+FTR], (6) Fgeomunitary = 1d+1+(1−1d+1)[d∏i=1FB,i⋅FTR], (7)

or a combination of the two. The first term in Eq. (7) ensures to take values in the same interval, , as for unitary evolution. only for a purely coherent time evolution that perfectly implements the desired gate for all states in the reduced set. While the arithmetic mean weights all state fidelities linearly, the geometric mean works best if the error is due to a single . An optimized way to extract information from all the is obtained by a suitable combination of the arithmetic and geometric mean: We define a fidelity that switches from the arithmetic mean to the geometric one, should the state fidelities for all the be close to one,

 Fλunitary=λFgeomunitary+(1−λ)Farithunitary (8a) with λ=1−1−∏di=1FB,i1−∏di=1FB,i⋅FTR. (8b)

The choice of is motivated as follows: such that if for all , i.e., in cases where the gate error is captured by alone; and yielding if , i.e., when the gate error is comprised in the .

Figure 1(a) shows the probability of obtaining a certain relative deviation of the estimated gate error for randomized dynamical maps and CNOT as the target gate. The randomized dynamical maps were obtained by creating a random matrix Miszczak et al. () for twice as many qubits as there are system qubits. The random matrices were hermitized, multiplied by a randomly chosen scaling factor and exponentiated. The resulting matrix was multiplied by the tensor product of the target unitary with , and the bath qubits were traced out. For most dynamical maps, yields a good estimate of the gate error. If, however, the state fidelities for all are very high, but the fidelity for the totally rotated state is comparatively small, the arithmetic mean seriously underestimates the gate error. This can happen, for example, if the evolution is perfectly unitary, , and and the target have a common eigenbasis with all the . Then the information relevant for the gate error is completely contained in . This is illustrated in Fig. 1(e) for randomized unitaries with an eigenbasis very close to the and . In such a case the geometric average over all state fidelities will yield a much better estimate of the gate fidelity. In most cases, however, the geometric mean is too strict and overestimates the gate error, motivating the definition (8). Indeed, the best estimates of the gate error are obtained using as shown in the right part of Fig. 1. Figure 1(a,b,e,f) presents results for randomized dynamical maps and randomized unitaries that were generated by exponentiating random Hermitian matrices. Since this is not truly random, we have also generated random unitaries based on Gram-Schmidt orthonormalization of randomly generated complex matrices Mezzadri (2007), cf. Fig. 1(c,d) with CNOT. yields a faithful estimate of the gate error in all cases. On average, it underestimates the gate error by factors 1.03 (Fig. 1b), 1.11 (d) and 1.02 (f) and overestimates it by 1.16 (b), 1.08 (d), and 1.01 (f). This illustrates that makes best use of the information contained in the state fidelities, and .

Bounds for over- and underestimating the gate error, obtained numerically, are presented in Table 1 with CNOT, identity and the Toffoli gate as target operations. For three-qubit gates, we find the numerical bounds to be essentially contained by those for two-qubit gates, cf. Table 1. This suggests our numerical bounds to be independent of system size. A verification of this conjecture for larger system sizes is, however, hampered by the enormous increase in numerical effort for randomization. For our examples of CNOT, the Toffoli gate and identity, we find the estimated gate error based on Eqs. (8) to deviate from the standard one in the worst case by a factor smaller than 2.5 and on average by a factor smaller than 1.2. This confirms that state fidelities are sufficient to accurately estimate the gate error.

### iii.2 Quantifying non-unitarity

If, in a given experimental setting, the gate error turns out to be larger than expected, one might want to know whether it is due to unitary errors or decoherence. This can be determined by quantifying non-unitarity of the time evolution using the following distance measure,

 Fdiss=1−1d+1{d∑i=1Tr[ρ2B,i(T)]+Tr[ρ2TR(T)]}, (9)

where . if and only if the evolution is completely unitary. Evaluation of requires preparation of the input states of Eq. (3) and measurement of populations.

Equation (9) cannot replace full process tomography when complete identification of the error sources is desired. However, some information can already be gained by inspection of the purities of Eq. (9). For example, if the purity loss is due to a single or very few terms in Eq. (9), this identifies the state evolutions that are subject to dissipation. On the other hand, if the purity loss is equally distributed over all basis states, the chosen basis is likely not an eigenbasis of the error operators (but another mutually unbiased basis presumably is).

## Iv Reduced set of states yielding analytical bounds on the average fidelity

We now connect our notion of a reduced set of input states to the result of Ref. Hofmann (2005) that two classical fidelities can be used to obtain an upper and a lower bound on the average fidelity. The classical fidelity is given by the average probability of obtaining the correct output for each of the classically possible input states,

 Fc = Missing or unrecognized delimiter for \right (10)

for an arbitrary orthonormal Hilbert space basis . It can be interpreted as the arithmetic average over the overlaps between expected and actual population evoluation for the basis states . Defining , such a classical fidelity can be rewritten analogously to Eq. (6),

 F1 = 1Nd∑i=1⟨k(1)i|U0D(ρ(1)i)U†0|k(1)i⟩ = 1Nd∑ij=1⟨k(1)j|k(1)i⟩⟨k(1)i|U0D(ρ(1)i)U†0|k(1)j⟩ = 1Nd∑i=1Tr[ρ(1)iU0D(ρ(1)i)U†0] = 1Nd∑i=1Tr[U†0ρ(1)iU0D(ρ(1)i)],

with the ideal and the actual evolutions. In our terminology, the states ’fix’ the basis, cf. Eq. (3a). In order to fulfill the requirements of a reduced set, i.e., to allow for differentiating any two unitaries and assessing unitarity of the time evolution, another state corresponding to the totally rotated projector is necessary, cf. Section II. Instead of a single state , Ref. Hofmann (2005) chooses such states with each state fulfilling the condition of total rotation: with

 ∣∣\Braketk(1)ik(2)j∣∣2=1d∀i,j,

i.e., a complete mutually unbiased basis Fernández-Pérez et al. (2011). Evaluating the classical fidelities for the two bases , then allows for analytical bounds on the average fidelity Hofmann (2005).

Note that Ref. Hofmann (2005) discusses a specific choice of the two bases. From our derivation in Section II, it is clear that any two mutually unbiased bases are suitable, and one can choose the most convenient ones. There exist mutually unbiased bases for qubits Wootters and Fields (1989), but only three of them consist of separable states while the remaining mutually unbiased bases are made up of maximally entangled states Lawrence (2011). Any two of the three separable mutually unbiased bases constitute a natural choice for most experimental setups.

## V Conclusions

We have shown that a reduced set of input states can be used to estimate the average fidelity or gate error of a quantum gate. It provides the information to characterize, instead of the full open system evolution, only the unitary part. The average over all Hilbert space can then be estimated by a modified average over a reduced set of states that allows to differentiate any two unitaries and quantify non-unitarity of the evolution. The states in the reduced set correspond to a complete set of orthonormal one-dimensional projectors plus a one-dimensional projector that is rotated with respect to all the other projectors. The reduced set can be realized by two mixed states, irrespective of the dimension of the Hilbert space, or by pure states. Our concept of total rotation is related to the notion of mutually unbiased bases Fernández-Pérez et al. (2011) where all states of the second basis are totally rotated with respect to the first basis. It is also the underlying principle in constructing the input states for two complementary classical fidelities Hofmann (2005). Consequently, one can estimate the average fidelity using or pure separable input states. In both cases, the gate error is determined in terms of state fidelities for the time-evolved states of the reduced set. The approach using input states comes with the advantage of analytical bounds on the gate error. For the smaller set of input states, numerical calculations demonstrate the estimate to deviate from the true gate error by less than a factor 1.2 on average and less than a factor 2.5 in the worst case.

While the average gate fidelity currently enjoys great popularity, other very useful performance measures exist Gilchrist et al. (2005). For example, the worst case fidelity is relevant in the context of the error correction threshold Bény and Oreshkov (2010). It would be interesting to see whether the or state fidelities of the reduced set allow for estimating bounds on the worst-case fidelity. This is, however, beyond the scope of our current work.

Another important question concerns the scaling of the gate error estimate employing a reduced set of states with the number of qubits. The straightforward, but not most efficient approach consists in determining the required or state fidelities by state tomography. This yields a scaling of for standard state tomography and for Monte Carlo state characterization Flammia and Liu (2011); da Silva et al. (2011), i.e., no improvement over current approaches. Alternatively, a reduced set of states can be combined with Monte Carlo process characterization Flammia and Liu (2011); da Silva et al. (2011). We show in Ref. Reich et al. (2013) that in this case the experimental effort and the classical computational resources to obtain tight analytical bounds on the average error are reduced by a factor compared to the best currently available protocol for general unitary operations.

The ability to measure the gate performance efficiently with a reduced set of input states is not only a prerequisite for the development of quantum devices; it also opens the door to designing quantum gates in coherent control experiments using e.g. genetic algorithms where repeated checks of the performance are required.

###### Acknowledgements.
We would like to thank Christian Roos for helpful comments. Financial support from the EC through the FP7-People IEF Marie Curie action Grant No. PIEF-GA-2009-254174 is gratefully acknowledged.

## Appendix A Proofs

We provide here detailed proofs of the claims made in Section II.

### a.1 Injectivity of M is equivalent to the commutant space K({ρi}) having identity as its only element

Definition: Let be a density operator defined in a -dimensional Hilbert space and elements of the projective unitary group . We call the set of operators

 K(ρ)={Ui∈PU(d)|[Ui,ρ]=0}

the commutant space of in . The commutant space of a set of density operators is defined as

 K({ρj})=⋂jK(ρj).

Proposition: The map which maps any unitary to the set of propagated density operators is injective iff the commutant space of in , , contains only the identity.

Proof: Injectivity of is equivalent to the condition

 ∀i:ρ(U)i(T)=ρ(V)i(T)⟺U=V

We first show that this condition is equivalent to

 ∀i:ρ(U)i(T)=ρi⟺U=\openone

Assuming validity of just choose . Then and the second statement follows immediately. Conversely, assume

 ∀i:ρ(U)i(T)=ρi⟺U=\openone

Then, for arbitrary we set and

 ∀i:ρ(V+W)i(T)=ρi ⟺ ∀i:V+WρiW+V=ρi ⟺ ∀i:WρiW+=VρiV+ ⟺ Missing or unrecognized delimiter for \left

By assumption , but since

 ∀i:ρ(V+W)i(T)=ρi⟺∀i:ρ(W)i(T)=ρ(V)i(T)

and the relation

 V+W=\openone⟺W=V

always holds for , this leads to the desired result: .

We now show that iff

 ∀i:ρ(U)i(T)=ρi⟺U=\openone

Consider the following calculation

 ∀i:ρ(U)i(T)=ρi ⟺ ∀i:UρiU+=ρi ⟺ ∀i:Uρi=ρiU ⟺ ∀i:Uρi−ρiU=0 ⟺ ∀i:[U,ρi]=0 (∗)⟺ U=\openone

The equivalence relation is true only iff . This concludes the proof.

### a.2 Total rotation and commutation with identity

Definition: Let be a -dimensional Hilbert space. A set of one-dimensional orthogonal projectors from onto itself is called complete. For example, spanning the Hilbert space by an arbitrary complete orthonormal basis , . A one-dimensional projector from onto itself is called totally rotated with respect to the set if . A set of projectors is called complete and totally rotating.

Definition: Let be a -dimensional Hilbert space. A set of density operators with is called complete if the set of projectors on the eigenspaces of the is complete and is called complete and totally rotating if the set of projectors on the eigenspaces of the is complete and totally rotating.

Our goal is to prove that the only projective unitary matrix that commutes with each element of a complete and totally rotating set of states is the identity. In order to make use of the assumed commutation relations in the proof, we translate commutation of a unitary with a state into commutation of a unitary with one or more projectors. To this end, we introduce a lemma. Using commutation of a unitary with projectors, it is then straightforward to show that the unitary must be the identity.

Lemma: If for a unitary and a density operator which has at least one non-degenerate eigenvalue , then where is the projector onto the eigenspace corresponding to the eigenvalue .

Proof: Since has a non-degenerate eigenvalue , we can expand it in a set of orthonormal projectors, , with the projector onto the one-dimensional eigenspace . By assumption,

 [U,ρ]=0 = λ1UP1−λ1P1U+d∑i=2(λiUPi−λiPiU) = λ1UP1U+−λ1P1+d∑i=2(λiUPiU+−λiPi),

where in the second line we have multiplied by from the right. Defining , this is equivalent to

 λ1¯P1+d∑i=2λi¯Pi=λ1P1+d∑i=2λiPi.

The operator equality can be applied to , leading to

 λ1¯P1|ξ1⟩+d∑i=2λi¯Pi|ξ1⟩=λ1|ξ1⟩.

Inserting identity, , in the right-hand side, we obtain

 λ1¯P1|ξ1⟩+d∑i=2λi¯Pi|ξ1⟩=λ1¯P1|ξ1⟩+d∑i=2λ1¯Pi|ξ1⟩.

Multiplying from the left by and using orthogonality of the and non-degeneracy of , , we find that for all . Therefore lies also in the one-dimensional eigenspace corresponding to , and the one-dimensional eigenspaces of and must be identical. This implies

 P1=¯P1,

and, by definition of , we find that leaves the one-dimensional eigenspace corresponding to invariant, hence commutes with .

Note that if a density operator that commutes with has more than one non-degenerate eigenvalue, the lemma implies commutation of with all the projectors onto the one-dimensional eigenspaces.

Proposition: The only projective unitary matrix that commutes with a set of states that is complete and totally rotating is the identity.

Proof: Repeated application of the lemma to states yields a set of one-dimensional projectors that each commute with . By definition of a complete and totally rotating set of states, projectors within this set must be elements of . We can thus choose the complete set of one-dimensional projectors to represent , . An equally valid choice employs the totally rotated projector, , with the corresponding eigenspace, and a suitable set of orthonormal one-dimensional projectors for the space such that . The spectrum is of course independent of the representation. Consider the action of on a vector ,

 U|ζ⟩ = d∑i=1uiPi|ζ⟩ (11) = d∑i=1ui~Pi|ζ⟩=u1|ζ⟩=d∑i=1u1Pi|ζ⟩,

where we have inserted in the last step. By total rotation, , or equivalently, . Applying this to , we find

 PiPTR|ζ⟩=Pi|ζ⟩≠0∀i.

Since the are one-dimensional orthonormal projectors, i.e., with a complete orthonormal basis of the Hilbert space, we can rewrite ,

 Pi|ζ⟩=μi|φi⟩

with , . Inserting this into Eq. (11), we obtain

 d∑i=1u1μi|φi⟩=d∑i=1uiμi|φi⟩.

Comparing the coefficients yields . Since all due to total rotation, we can divide and obtain

 u1=ui∀i,

i.e., a unitary with complete degeneracy in its eigenvalues. This necessarily has to be the matrix for , or, as an element of , the unit matrix.

We have thus shown that only the identity commutes with a set of states that is complete and totally rotating. This set of states is therefore sufficient to differentiate any two unitaries.

### a.3 Unitarity of D is equivalent to projectors being mapped onto projectors

Proposition: A dynamical map , defined on a -dimensional Hilbert space, is unitary if and only if maps (i) a set of one-dimensional orthonormal projectors onto a set of one-dimensional orthonormal projectors and (ii) a one-dimensional projector that is totally rotated with respect to onto a one-dimensional projector (which is totally rotated with respect to ).

Proof: We first prove the forward direction. If the time evolution is unitary, the action of on any state is described by . Specifically for orthonormal projectors , we find

 D(Pi)D(Pj)=UPiU+UPjU†=UPiPjU†=δijUPiU†.

Since a one-dimensional projector can be written , where is a complete orthornormal basis of , is also one-dimensional projector. By the same argument, is mapped onto a one-dimensional projector if . Therefore a dynamical map describing unitary time evolution maps a set of orthonormal projectors, , onto another such set, , and onto a one-dimensional projector.

We now prove the backward direction, starting from the representation of ,

 D=K∑k=1EkρE+k, (12)

by Kraus operators , i.e., linear operators that fulfill

 K∑k=1E+kEk=\openone. (13)

We employ the canonical representation in which the Kraus operators are orthogonal, . By assumption, a set of one-dimensional, orthonormal projectors is mapped by onto another such set ,

 D(Pi)=K∑k=1EkPiE+k=~Pi. (14)

We need to show that this implies , or equivalently, as we demonstrate below, that is made up of a single Kraus operator in the representation where . In general, we can employ a polar decomposition for each Kraus operator, factorizing it into a unitary and a positive-semidefinite operator, . For unitary evolution, for all and which is a special case of being diagonal. We first show that the assumption for the orhonormal projectors implies and diagonality of . In a second step, we prove that the assumption for the totally rotated projector implies that there is only a single Kraus operator and .

We first show that is diagonal in the orthonormal basis corresponding to the . Equation (14) suggests the definition of an operator which is obviously Hermitian and moreover semipositive definite. The latter is seen by making use of and : for any . Equation (14) implies . For the normalized vector spanning the eigenspace of , , we find

 K∑k=1⟨~φi∣∣∣Π(i)k~φi⟩=1,

while for all

 K∑k=1⟨ξ∣∣∣Π(i)kξ⟩=0.

Due to positive semidefiniteness of , this implies . Reinserting the definition of leads to , i.e., we find for all , and . For an arbitrary Hilbert space vector , lies in such that for all and . Therefore

 PiE+k(\openone−~Pi)=0,or,PiE+k=PiE+k~Pi∀i,k.

To make use of the orthogonality of the , we multiply by , from the right. Since can be written as for a specific , we obtain, for all , and , . Multiplication by from the right yields

 PiE+k~UPj=0.

This implies that the operators have to be diagonal in the basis corresponding to the ,

 E+k~U=d∑i=1ekiPi. (15)

Note that the unitary is the same for all Kraus operators .

In the second step, we now need to show that the right-hand side of Eq. (15) is equal to the identity, making use of the assumption that the totally rotated projector is mapped by onto a one-dimensional projector. The crucial information is captured in the coefficients . Let us summarize what we know about the . From orthogonality of the Kraus operators, we find . The last sum can be interpreted as a scalar product for two orthogonal vectors with coefficients , . Defining the proportionality constants ,

 N(k)≡Tr[E+kEk]=∑ieki(eki)∗=⟨→ek,→ek⟩≥0, (16)

we find from Eq. (13) and that (and, if we can show that for one , than the number of Kraus operators, , must be one). Equation (13) together with Eq. (15) yields yet another condition on the : such that for each . This can be interpreted as normalization condition for a vector


text:
# Bound of spectral radius of polynomial of a complex matrix

I am trying to prove or disprove the following inequality.

$$||P(A)||_2\leq 2 \max_{\alpha\in W(A)}| P(\alpha)|,$$

where $P(\cdot)$ is a complex polynomial, $A\in \mathbb{C}^{n\times n}$ and $W(A)=\{ x^*Ax:||x||_2=1\}$ is the numerical range of $A$ and $||\cdot||_2$ is the spectral norm.

I know that for $P(x)=x^n$ (power inequality) or $P$ is linear or for $A$ normal(as $W(A)$ contains all the eigenvalue of $A$) or all coefficient of $P$ is real and of the same sign(using triangle inequality) , the inequality would be true.

I have used computer program for randomly generated matrix or the nilpotent matrix with $2\times2,3\times3,10\times10$ , and the inequality turns out to be true.

I have tried to prove it but I cannot succeed. I attempt to show $w(P(A))\leq \max_{\alpha\in W(A)} |P(\alpha)|$ where $w(\cdot)$ is the numerical radius since $||M||_2\leq 2 w(M),\forall M$. But it turns out not to be true always.

Have you encountered this inequality somewhere or any idea about the approaches you would try to prove this? Or you could give some conditions so that the inequality is true? Or maybe relax the range of $\alpha$ (not just $W(A)$) so that we have a similar inequality?

Any help would be appreciated!!

• Would you mind telling us where this question comes from? (I happen to have read one of the relevant papers and this does not seem like a question one would be led to without someone suggesting it) – Yemon Choi Feb 3 '15 at 2:25
• No offence, I am just curious if someone has set this problem as a project, specifically in the hope that one would not go hunting in the literature – Yemon Choi Feb 3 '15 at 2:26
• @YemonChoi， I am not sure whether this is project or not. One of my professors just asks me this question as I did well in one of his classes. Is it impropriate to ask this kind of question here? – Brian Ding Feb 3 '15 at 2:52
• Let's write it down clearly: this is an open problem known as Crouzeix conjecture. – Federico Poloni Feb 12 '15 at 11:29


text:
I. Basic math.
 II. Pricing and Hedging.
 III. Explicit techniques.
 IV. Data Analysis.
 V. Implementation tools.
 1 Finite differences.
 2 Gauss-Hermite Integration.
 3 Asymptotic expansions.
 4 Monte-Carlo.
 5 Convex Analysis.
 A. Basic concepts of convex analysis.
 B. Caratheodory's theorem.
 C. Relative interior.
 D. Recession cone.
 E. Intersection of nested convex sets.
 F. Preservation of closeness under linear transformation.
 G. Weierstrass Theorem.
 H. Local minima of convex function.
 I. Projection on convex set.
 J. Existence of solution of convex optimization problem.
 K. Partial minimization of convex functions.
 L. Hyperplanes and separation.
 M. Nonvertical separation.
 N. Minimal common and maximal crossing points.
 O. Minimax theory.
 Q. Polar cones.
 R. Polyhedral cones.
 S. Extreme points.
 T. Directional derivative and subdifferential.
 U. Feasible direction cone, tangent cone and normal cone.
 V. Optimality conditions.
 W. Lagrange multipliers for equality constraints.
 X. Fritz John optimality conditions.
 Y. Pseudonormality.
 Z. Lagrangian duality.
 [. Conjugate duality.
 VI. Basic Math II.
 VII. Implementation tools II.
 VIII. Bibliography
 Notation. Index. Contents.

## Polar cones.

efinition

(Polar cone definition). For a nonempty set we define the polar cone :

The following statement is a direct consequence of the definitions.

Proposition

(Polar cone properties). For any nonempty set , we have

1. is a closed convex set.

2. .

3. If for some set then .

Proposition

(Polar cone theorem). For any nonempty cone we have

If is closed and convex then .

Proof

First, we show that for any nonempty we have . Indeed, by the definitions, for a fixed Therefore, .

Next, we prove that for a closed nonempty , we have .

Let . Since is closed, there exists the projection . Let us translate the coordinate system so that . Then by the proposition ( Projection theorem )-2 we have Hence, We already established that Therefore, but also Hence, for a nonempty set (empty is a trivial case) we have By the definition of polar cone, we always have for a nonempty . Hence, .

Finally, we prove that . By the proposition ( Polar cone properties ), we have Therefore, We already proved that .

 Notation. Index. Contents.


text:
Should Tonight's Oscar Winners Say That All People Are Made Of Atoms, And That This Is Why Jobs And Money Shouldn't Exist?

Oscars Jobs Money Economics Politics Sociology atoms

8 replies to this topic

#1 Mariel33

Mariel33

Questioning

• Members
• 115 posts

Posted 26 February 2017 - 12:21 PM

Whether it's Emma Stone, Ryan Gosling or Nicole Kidman, tonight's Oscar winners could alternatively say that people who don't want Mondays to exist should refuse to talk about science and the universe.

Do you think any of these actors should say these things, or do you think they would?

#2 Farming guy

Farming guy

Explaining

• Members
• 949 posts

Posted 26 February 2017 - 05:26 PM

There are some fairly crazy actors, but I doubt they are that crazy.   Most of them seem to enjoy the high life that money can buy.

Why should we care what they say anyway?

#3 Mariel33

Mariel33

Questioning

• Members
• 115 posts

Posted 26 February 2017 - 05:31 PM

There are some fairly crazy actors, but I doubt they are that crazy.   Most of them seem to enjoy the high life that money can buy.

Why should we care what they say anyway?

It would be a cool historic moment. It just seems obvious that the status quo is immoral, and because actors are meant to be inspiring anyway, it might as well be at the Oscars that the public and world's population get to have that historic moment.

Beyond that, it just feels absurd that history is what it is, given that no one looks forward to Mondays; why did the Roman Empire exist, or the Second World War, or why has reality been companies and lawsuits and festivals when weekends and Mondays make people sad?

Edited by Mariel33, 26 February 2017 - 05:33 PM.

#4 Farming guy

Farming guy

Explaining

• Members
• 949 posts

Posted 26 February 2017 - 06:11 PM

It would be a cool historic moment. It just seems obvious that the status quo is immoral, and because actors are meant to be inspiring anyway, it might as well be at the Oscars that the public and world's population get to have that historic moment.

Beyond that, it just feels absurd that history is what it is, given that no one looks forward to Mondays; why did the Roman Empire exist, or the Second World War, or why has reality been companies and lawsuits and festivals when weekends and Mondays make people sad?

Personally, I can't really think of any actors that I find particularly inspiring.  Sure, I find many to be entertaining, but I prefer to know nothing about actors so as not to be distracted from the acting performance.  I think giving awards to people who are already being given huge amounts of money is a rather silly thing to do.  Why don't electricians, plumbers, groundskeepers and the like  get awards shows?

How do you know that no one looks forward to Mondays?  Some people love their chosen professions, and some of us work every day of the week anyway!

#5 exchemist

exchemist

Creating

• Members
• 2272 posts

Posted 27 February 2017 - 11:50 AM

Personally, I can't really think of any actors that I find particularly inspiring.  Sure, I find many to be entertaining, but I prefer to know nothing about actors so as not to be distracted from the acting performance.  I think giving awards to people who are already being given huge amounts of money is a rather silly thing to do.  Why don't electricians, plumbers, groundskeepers and the like  get awards shows?

How do you know that no one looks forward to Mondays?  Some people love their chosen professions, and some of us work every day of the week anyway!

Agree. And very funny that this overblown and self-congratulatory ceremony has been cocked up, this time round. For some reason it has been the lead item of news today. It is hard to imagine anything more trivial.

I've nothing against an evaluation of the best film every year, just as there is for the best new novel, but the scale of it and the synthetic emotion make my toes curl.

#6 Mariel33

Mariel33

Questioning

• Members
• 115 posts

Posted 27 February 2017 - 12:07 PM

Agree. And very funny that this overblown and self-congratulatory ceremony has been cocked up, this time round. For some reason it has been the lead item of news today. It is hard to imagine anything more trivial.

I've nothing against an evaluation of the best film every year, just as there is for the best new novel, but the scale of it and the synthetic emotion make my toes curl.

Should all ceremonies be ended, including all military and government ceremonies? I ask because of the probability that the Oscars is a reaction to the military, Wall Street and government.

Edited by Mariel33, 27 February 2017 - 12:09 PM.

#7 Farming guy

Farming guy

Explaining

• Members
• 949 posts

Posted 27 February 2017 - 04:46 PM

Should all ceremonies be ended, including all military and government ceremonies? I ask because of the probability that the Oscars is a reaction to the military, Wall Street and government.

I don't think it's a good idea to force an end to ceremonies.  A lot of people seem to like ceremonies, even if some of us find them tiresome.  I think we shouldn't make such a big deal about them.

The Oscars and other big awards shows have little to do with anything other than money and the need to feed some egos.

#8 Mariel33

Mariel33

Questioning

• Members
• 115 posts

Posted 27 February 2017 - 05:03 PM

I don't think it's a good idea to force an end to ceremonies.  A lot of people seem to like ceremonies, even if some of us find them tiresome.  I think we shouldn't make such a big deal about them.

The Oscars and other big awards shows have little to do with anything other than money and the need to feed some egos.

Is it possible that atoms and the universe need ceremonies, whether it's Oscars or military or government?

Edited by Mariel33, 27 February 2017 - 05:03 PM.

#9 CraigD

CraigD

Creating

• 8034 posts

Posted 09 March 2017 - 08:10 AM

The Oscars and other big awards shows have little to do with anything other than money and the need to feed some egos.

Money is a very important thing in our society, some might argue the most important thing, and I think the Academy Awards, for all their near total lack of mention of money, are primarily about it. I think it’s a mistake and misunderstanding to think of them, as you and exchemist seem to, as mere and empty ceremony and ego stroking.

The nearly 6000 Academy members who vote for Oscar nominees and winners nearly all have financial interests in films. Having a film nominated, or better, win and Oscar, can greatly increase the amount of money that film, and thus its investors, make, or decrease the amount they lose.

I’ve noticed that Oscar winning films are often ones that, despite their high quality, were unprofitable in their theatrical releases. Often, after winning, they are re-released, and thanks to their Oscar publicity, are better viewed, resulting in their investors going from losing money to making it. Consider this year’s Best picture and 2 other awards winner Moonlight: according to its IMDB box office/business page, it cost $5,000,000, but in its short October 2016 theatrical run, made only about$1,421,000. Following its Oscar wins, it is now being re-released in many theatres near me, and I would not be surprised if turns a profit.

Although I can’t prove that this actually happens, I suspect that Academy members do favors to for their fellows who have lost money on credibly good films, by voting them awards they would not have had they been profitable.

I don’t mean to imply this financial give-and-take, quid-pro-quo is a bad thing. Rather, I think it is on the whole a very good thing, allowing people to make interesting movies with lessened concern about their financial viability. I do mean to imply that the Oscars are not the simple “best of the year” awards they purport to be.


text:
# Tutte seminar - Ben Salisbury - cancelled

Friday, March 28, 2014 — 3:30 PM EDT

## The Gindikin-Karpelevich Formula and Combinatorics of Crystals

Speaker: Jintai Ding University of Cincinnati Mathematics and Computer Building (MC) 5168

### Abstract:

The Gindikin-Karpelevich formula computes the constant of proportionality for the intertwining integral between two induced spherical representation of a $p$-adic reductive group $G.$ The right-hand side of this formula is a product over positive roots (with respect to the Langlands dual of $G$) which may also be interpreted as a sum over a crystal graph. The original interpretation as a sum is due to Brubaker-Bump-Friedberg and Bump-Nakasuji where $G=GL_{r+1},$  in  which  vertices  of the crystal graph are parametrized by paths to a specific vector in the graph according to a pattern prescribed by a reduced expression of the longest element of the Weyl group of $G$. I will explain this rule, explain how it may be translated into a statistic on the Young tableaux realization of the same crystal graph, and discuss its generalization to the affine Kac-Moody setting where the notion of the longest element of the Weyl group no longer makes sense.

This is joint work with Kyu-Hwan Lee, Seok-Jin Kang, and Hansol Ryu.

Location
MC - Mathematics & Computer Building
5158
200 University Avenue West

Waterloo, ON N2L 3G1

### January 2022

S M T W T F S
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
12
14
15
16
19
20
22
23
26
29
30
31
1
2
3
4
5
1. 2022 (12)
1. January (12)
2. 2021 (103)
1. December (3)
2. November (7)
3. October (6)
4. September (12)
5. August (6)
6. July (10)
7. June (12)
8. May (7)
9. April (9)
10. March (13)
11. February (8)
12. January (10)
3. 2020 (119)
4. 2019 (167)
5. 2018 (136)
6. 2017 (103)
7. 2016 (137)
8. 2015 (136)
9. 2014 (88)
10. 2013 (48)
11. 2012 (39)
12. 2011 (36)
13. 2010 (40)
14. 2009 (40)
15. 2008 (39)
16. 2007 (15)


text:
0
8.9kviews
Compare ground wave and sky wave propogation.
0
164views

On earth there are two methods of propagation i.e. ground wave and sky wave.

• In free space propagation occurs in the straight line or line of sight wave.

• Below let us compare the difference between ground wave and sky wave propagation.

Ground wave propagation:

• Ground waves exists between below 2MHz and covers ELF, SLF, ULF, VLF, LF and MF frequency bands.

• The signal exists in proximity to the earth surface, it follows contour of earth and hence it can propagate considerable distances.

• At lower frequencies, interference occurs due to atmospheric noise only, here trans it power is sufficient and hence maximum range of about 5000 miles can be achieved.

• Optimum antenna size is about $\lambda$/2 , As the distance from transmitter increases received signal strength decreases and follows exponential curve.

• They are also known as surface waves.

Sky wave propagation:

• Sky wave exists between 2MHz to 30MHz and covers ELF, SLF, ULF, LF, MF and HF frequency bands.

• It exists in the sky and depends on reflective characteristics of ionosphere layer, the signal reflected from ionized layer of the atmosphere.

• In this propagation mode, signal can travel number of hops, back and forth, the example of this type is SW radio.

• During right time, ionosphere layer is closer to the earth surface, it travels at a flatter angle, it travels larger distances there are more skip zones which results into no reception.

• During the daytime, ionosphere layer is away from earth surface, it travels with an angle it travels smaller distances.


text:
# Naming object issues

I'm trying to add some items to the scene and rename them but ran into some issues. Example code:

import bpy
context = bpy.context
name = "Cube"

item = context.active_object
item.name = name

item = context.active_object
item.name = name

I thought that this code would name the first cube to "Cube" and the second cube to Cube.001, but it actually does the opposite and I end up with the second cube (10,20,30) named Cube and the first is named Cube.001. Is this a bug?

Is there anyway around this other than manually looping over existing objects and generating a unique name?

I would be happy to use bmesh instead (as that will give me the expected behaviour), but I can't get that method to work either as I need to create a uv map as well. Example workaround:

import bpy
import bmesh

bm = bmesh.new()
bmesh.ops.create_cube(bm, size=1.0, calc_uvs=True)
mesh_name = "Cube"
mesh_data = bpy.data.meshes.new(mesh_name)
bm.to_mesh(mesh_data)
bm.free()

mesh_obj = bpy.data.objects.new(mesh_data.name, mesh_data)

• No.  bpy.data.objects["name"]is a map/dictionary. And you can test using "bpy.data.objects.get("name") Sep 29, 2020 at 14:43


text:
# How to draw a dotted rectangle around part of equation?

1,570

## Solution 1

The dashbox package can be tweaked to do what you want:

\documentclass{article}

\usepackage{dashbox}
\newcommand\emptydottedbox{%
\setlength{\dashlength}{1pt}%     % length of dash + gap
\setlength{\dashdash}{0.5pt}%     % length of dash
\setlength{\fboxrule}{0.5pt}%     % width of line
\setlength{\fboxsep}{0pt}%        % separation between box and inner content
\dbox{\ensuremath{\phantom{x}}}%
}

\begin{document}

$\int_{\emptydottedbox}^{\emptydottedbox} \emptydottedbox$

\end{document}

## Solution 2

With tikz you can draw these boxes:

\documentclass{article}
\usepackage{tikz}
\newcommand{\smallbox}{\begin{tikzpicture}
\draw[thick,dotted] (0,0) rectangle
(0.3, 0.3);
\end{tikzpicture}
}
\newcommand{\medbox}{\begin{tikzpicture}
\draw[thick,dotted] (0,0) rectangle
(0.5, 0.5);
\end{tikzpicture}
}
\begin{document}

$\int_{\smallbox}^{\smallbox} {\medbox}$
\end{document}

Maybe you need to fiddle a bit with the dimensions and/or the spacing.

Share:
1,570

Author by

### Denis Sletkov

Updated on November 18, 2020

• Denis Sletkov over 1 year

I need to produce a following image:

I found a \boxdot symbol in ams package but can not find any dotted box.

• John Kormylo over 5 years
\boxdot (from amssymb) is a box with a dot inside. The easiest way to create a dotted box of a given size is to use TikZ (or possibly graphicx if you have an image).
You might want some more %, try a\emptydottedbox b outside math mode.
You could generalize it, with e.g. \newcommand\DotBox[1][0.3]{\tikz\draw[thick,dotted] (0,0) rectangle (#1,#1);}. (And by the way, you also have a spurious space, add a % right after \end{tikzpicture}, or move the closing brace up.)


text:
## University Calculus: Early Transcendentals (3rd Edition)

$$\frac{dp}{dq}=-\frac{(5p^2+2p)^{5/2}}{3(5p+1)}$$
$$q=(5p^2+2p)^{-3/2}$$ To find $dp/dq$, we would use the methods of implicit differentiation. Differentiate both sides of the equation with respect to $q$: $$1=-\frac{3}{2}(5p^2+2p)^{-5/2}(5p^2+2p)'$$ $$1=-\frac{3}{2}(5p^2+2p)^{-5/2}\Big(10p\frac{dp}{dq}+2\frac{dp}{dq}\Big)$$ $$1=-\frac{3}{2}(5p^2+2p)^{-5/2}(5p+1)2\frac{dp}{dq}$$ $$1=-3(5p^2+2p)^{-5/2}(5p+1)\frac{dp}{dq}$$ Then calculate for $dp/dq$: $$\frac{dp}{dq}=-\frac{1}{3(5p^2+2p)^{-5/2}(5p+1)}$$ $$\frac{dp}{dq}=-\frac{(5p^2+2p)^{5/2}}{3(5p+1)}$$


text:
Conference paper Open Access

# Near-Duplicate Video Retrieval with Deep Metric Learning

Kordopatis-Zilos, Giorgos; Papadopoulos, Symeon; Patras, Ioannis; Kompatsiaris, Yiannis

### JSON-LD (schema.org) Export

{
"description": "
This work addresses the problem of Near-Duplicate Video Retrieval (NDVR). We propose an effective video-level NDVR scheme based on deep metric learning that leverages Convolutional Neural Network (CNN) features from intermediate layers to generate discriminative global video representations in tandem with a Deep Metric Learning (DML) framework with two fusion variations, trained to approximate an embedding function for accurate distance calculation between two near-duplicate videos. In contrast to most state-of-the-art methods, which exploit information deriving from the same source of data for both development and evaluation (which usually results to dataset-specific solutions), the proposed model is fed during training with sampled triplets generated from an independent dataset and is thoroughly tested on the widely used CC WEB VIDEO dataset, using two popular deep CNN architectures (AlexNet, GoogleNet). We demonstrate that the proposed approach achieves outstanding performance against the state-of-the-art, either with or without access to the evaluation dataset.
",
"creator": [
{
"affiliation": "CERTH-ITI",
"@type": "Person",
"name": "Kordopatis-Zilos, Giorgos"
},
{
"affiliation": "CERTH-ITI",
"@type": "Person",
},
{
"affiliation": "CERTH-ITI",
"@type": "Person",
"name": "Patras, Ioannis"
},
{
"affiliation": "CERTH-ITI",
"@type": "Person",
"name": "Kompatsiaris, Yiannis"
}
],
"headline": "Near-Duplicate Video Retrieval with Deep Metric Learning",
"datePublished": "2017-10-23",
"url": "https://zenodo.org/record/852351",
"keywords": [
"Near-Duplicate",
"Video Retrieval",
"Deep Metric Learning"
],
"@context": "https://schema.org/",
"identifier": "https://doi.org/10.5281/zenodo.852351",
"@id": "https://doi.org/10.5281/zenodo.852351",
"@type": "ScholarlyArticle",
"name": "Near-Duplicate Video Retrieval with Deep Metric Learning"
}
145
105
views


text:
# [luatex] MPlib + graphictext

Troy Henderson thenders at gmail.com
Wed Dec 4 13:56:33 CET 2019

>
>      \startMPpage
>      % drawing....
>      \stopMPpage
>

Thank you Henri.  I have used ConTeXt a bit in the past, and so I am
familiar with this.  One feature that I would like to know how to
accomplish is how to use a True/Open Type Font (TTF/OTF) without having to
go through the entire installation process of such a font.  In LuaLaTeX, I
simply have to place my custom TTF/OTF in the same directory as my .tex
file and do

\begin{document}
\usepackage{fontspec}
\setmainfont{myfont.ttf}
\begin{document}
...
\end{document}

I cannot find the corresponding way in ConTeXt to accomplish this.  In
years past, I used the simplefonts module to use True Type Fonts, but that
may be obsolete.  The following does not work for me

\usemodule[simplefonts]
\setmainfont[myfont.ttf]
\startMPpage
% drawing
\endMPpage

I would appreciate help with this.  Thank you in advance,

Troy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://tug.org/pipermail/luatex/attachments/20191204/432500dc/attachment.html>

More information about the luatex mailing list


text:
# Dissecting ARM's Machine Readable Specification

Last week, ARM released their Machine Readable Architecture Specification and I wrote about what you can do with it. But before you can do anything with the specification, you need to extract the useful bits from the release so I thought I would try for myself and describe what I found out (and release some scripts that demonstrate/test what I am saying).

So what exactly is in the release?

• It contains a lot of html files (see Milosch Meriac’s online v8-A html)

$tar ztf A64_v82A_ISA_xml_00bet3.1.tar.gz | grep xhtml ISA_v82A_A64_xml_00bet3.1/xhtml/ ISA_v82A_A64_xml_00bet3.1/xhtml/rev.html ISA_v82A_A64_xml_00bet3.1/xhtml/sabd_advsimd.html ISA_v82A_A64_xml_00bet3.1/xhtml/smlal_advsimd_vec.html ISA_v82A_A64_xml_00bet3.1/xhtml/rev16_int.html ISA_v82A_A64_xml_00bet3.1/xhtml/dup_advsimd_gen.html ISA_v82A_A64_xml_00bet3.1/xhtml/ushl_advsimd.html ISA_v82A_A64_xml_00bet3.1/xhtml/staddb.html ISA_v82A_A64_xml_00bet3.1/xhtml/orr_advsimd_imm.html ... 1300 more files omitted  These are the human readable version of the specification — all nicely hyperlinked. This is the best way to navigate the ARM specification. • It contains some pdf files $ tar ztf A64_v82A_ISA_xml_00bet3.1.tar.gz | grep pdf
ISA_v82A_A64_xml_00bet3.1.pdf
ISA_v82A_A64_xml_00bet3.1_OPT.pdf
ISA_v82A_A64_xml_00bet3.1_OPT_diff.pdf

These contain the same information as the html files above. The “OPT” versions are equivalent to the standard version but they have had some simplifying optimisations applied to make them more readable. The “OPT_diff” versions show the difference between the standard version and the OPT version — the best way of understanding what the OPT version does.

• It contains some xml files

\$ tar ztf A64_v82A_ISA_xml_00bet3.1.tar.gz | grep xml
ISA_v82A_A64_xml_00bet3.1/
ISA_v82A_A64_xml_00bet3.1/fcvtps_float.xml
ISA_v82A_A64_xml_00bet3.1/sbfiz_sbfm.xml
ISA_v82A_A64_xml_00bet3.1/versions.txt
... 3000 more files omitted

This is the bit that we want! There are two files of particular interest:

• notice.xml ARM’s legal notice
• shared_pseudocode.xml hundreds of shared support functions used in the definition of instructions, page table walk, permission checking, exceptions/interrupts, etc.

And the rest of the files are instruction encodings such as adc.xml.

• And it contains files like a DTD file that defines the XML schema used by the XML.

## Inside the Shared XML files

The Shared XML files contain all the type definitions, constants, variables and functions required by the instructions and system support code. Here is how a typical function is presented in XML:

<ps name="aarch32/debug/breakpoint/AArch32.BreakpointMatch"
enclabels=""
sections="1"
secttype="Library">
section="Functions"
rep_section="functions">
// AArch32.BreakpointMatch()
// =========================
// Breakpoint matching in an AArch32 translation regime.

(boolean,boolean) <anchor link="AArch32.BreakpointMatch.3" hover="...">AArch32.BreakpointMatch</anchor>(integer n, bits(32) vaddress, integer size)
assert ELUsingAArch32();
... more code
</pstext>
</ps>

This shows a named “ps” section containing a small number of related definitions (just one in this case) and with the ASL implementation of the function enclosed in a “pstext” section. Almost all objects defined in the pstext section are tagged with “anchor” and almost all references to objects in the pstext section are tagged with “a”. (We will use these links later.) The rest of the XML attributes are mostly useful for generating HTML — I will ignore them.

As we process this ASL code, it will be useful to track what definitions each “ps” section contains and what the section depends on. Here is a Python class to represent this (the full code is here).

class ASL:
'''Representation of ASL code consisting of the code, list of names it defines and list of dependencies'''

def __init__(self, name, code, defs, deps):
self.name = name
self.code = code
self.defs = defs
self.deps = deps

def __str__(self):
return "ASL{"+", ".join([self.name, str(self.defs), str(self.deps)])+"}"

and here is some code to read the XML, extract dependencies and package it up as an ASL object.

'''
Read pseudocode to extract ASL.
'''
name = ps.attrib["name"]
name = name.replace(".txt","")
name = name.replace("/instrs","")
name = name.replace("/Op_","/")
chunk = ps.find("pstext")

# list of things defined in this chunk
defs = { x.attrib['link'] for x in chunk.findall('anchor') }

# extract dependencies from hyperlinks in the XML
deps = { x.attrib['link'] for x in chunk.findall('a') if not x.text.startswith("SEE") }

# drop impl- prefixes in links
deps = { re.sub('(impl-\w+\.)','',x) for x in deps }
defs = { re.sub('(impl-\w+\.)','',x) for x in defs }

# drop file references in links
deps = { re.sub('([^#]+#)','',x) for x in deps }

return ASL(name, ET.tostring(chunk, method="text").decode().rstrip()+"\n", defs, deps)

'''
Read shared pseudocode files to extract ASL.
'''
asl = {}
for f in files:
xml = ET.parse(f)
for ps in xml.findall('.//ps_section/ps'):
# Various workarounds omitted - see github repo
asl[r.name] = r
return asl

## Inside the Instruction XML files

The ARM architecture often contains several different encodings for a single instruction. Each instruction shares some common ASL code to execute the instruction and (optionally) to perform part of the decoding. The “pstext” sections containing these are labelled “Execute” and “Postdecode”. Some instructions are just aliases for other instructions so they don’t contain an execute section — I will discard these instructions.

def readInstruction(xml):
execs = xml.findall(".//pstext[@section='Execute']/..")
posts = xml.findall(".//pstext[@section='Postdecode']/..")
assert(len(posts) <= 1)
assert(len(execs) <= 1)
if not execs: return None # discard aliases

post = readASL(posts[0]) if posts else None

These pieces of ASL can be shared by several different instruction encodings and each encoding is accompanied by a piece of ASL to interpret the fields of the encoding.

    # for each encoding, read instructions encoding, matching decode ASL and index
encs = []
for iclass in xml.findall('.//classes/iclass'):

Instruction encodings and register descriptions use a common section format called “regdiagram”. One of the key pieces of information about an instruction is which instruction set it belongs to. The XML uses four different tags: “T16” (Thumb-32 short encoding), “T32” (Thumb-32 long encoding), “A32” (ARM-32 encoding) and “A64” (ARM-64 encoding). The T16 encoding is 16-bits long and all the others are 32-bits long.

        encoding = iclass.find('regdiagram')
isT16 = encoding.attrib['form'] == "16"
insn_set = "T16" if isT16 else iclass.attrib['isa']

The “regdiagram” section contains a number of boxes corresponding to one or more contiguous bits within the encoding. The location of each box is specified by the width of the box and the highest bit position in the box. Awkwardly, the T16 encoding numbers its bits from 31 down to 16 instead of from 15 down to 0 so my script fixes that.

        fields = []
for b in encoding.findall('box'):
wd = int(b.attrib.get('width','1'))
hi = int(b.attrib['hibit'])
# normalise T16 encoding bit numbers
if isT16: hi = hi-16
lo = hi - wd + 1

Some boxes have an attribute ‘name’, I use “_” for any anonymous boxes.

            nm  = b.attrib.get('name', '_')

And some boxes have a constant bitvector made up of “0”, “1”, “x”, “(0)” or “(1)”. 0 and 1 should be obvious, x means “don’t care” and (0) and (1) mean “should be 0/1 and it is UNPREDICTABLE what happens if they are not.” I use a suitable number of “x”s for any field with no constant specified.

The constant can also take the form “!= 1111” meaning “must not equal 1111”. This check is always replicated in the ASL code so I discard that information for now.

            consts = ''.join([ c.text for c in b.findall('c') if c.text is not None ])

# normalise constants: note that it discards != information
# because it is better obtained elsewhere in spec
if consts == "" or consts.startswith('!='):
consts = 'x'*wd

Sometimes the XML splits a single field into two adjacent fields: typically one of the fields has a constant value. When this happens, the fields have a name like “reg<4:1>” and “reg<0>”. This is not very convenient for our purposes so I look for this pattern and merge them back into a single field called “reg”.

            # if adjacent entries are two parts of same field, join them
# e.g., imm8<7:1> and imm8<0>
m = re.match('^(\w+)<', nm)
if m:
nm = m.group(1)
split = True
if fields[-1][3] and fields[-1][2] == nm:
(hi1,lo1,_,_,c1) = fields.pop()
assert(lo1 == hi+1) # must be adjacent
hi = hi1
consts = c1+consts
else:
split = False

fields.append((hi,lo,nm,split,consts))

To finish off reading an encoding, we read the decode ASL and pick a good name for the instruction encoding.

        dec_asl = readASL(iclass.find('ps_section/ps'))

name = dec_asl.name if insn_set in ["T16","T32","A32"] else encoding.attrib['psname']
encs.append((name, insn_set, fields, dec_asl))

Finally, the collection of the encodings, the postdecode ASL and the execute ASL are packaged up as an instruction named after the shared execute ASL.

    return Instruction(exec.name, encs, post, exec)

And to read all the instructions in a directory, we use the following code:

instrs = []
for d in args.dir:
for inf in glob.glob(os.path.join(d, '*.xml')):
name = re.search('.*/(\S+).xml',inf).group(1)
if name == "onebigfile": continue
xml = ET.parse(inf)
if instr is None: continue
instrs.append(instr)

## Sorting the shared code

Once you have extracted all the code, you are going to want to process it in some way. This will probably be easier to do if we arrange the ASL type and function definitions so that definitions always occur before their first use. So my script uses the dependencies that we extracted from the ASL to perform a topological sort of the code.

There are several modes it can work in:

• Sort all the code. This will include code used by instructions but also code used when an interrupt occurs or an external debugger is attached.
• Extract all the code that is used by AArch64 instructions. That is, instructions using the A64 encodings.
• Extract all the code that is used by AArch32 instructions. That is, instructions using the A32 encodings.
• Extract all the code used by AArch64 or AArch32 instructions.

## Conclusion

I hope this is useful for those who want to make use of ARM’s Machine Readable Architecture specification. The files are designed to meet many different purposes so it is not always obvious which parts of them are useful for your purpose. This is why I thought it would be a good idea to write some scripts that actually extract the code instead of just writing about how I believe you can do it.

At work, I have access to the raw files from which the XML files are built so it has been a while since I have tried to extract the specification from the XML and it has been interesting seeing how much easier it is to use the XML files than it was when I first started using the architecture specs. (But there were some issues that I had to work around as well — search the script for the word “workaround” for details.)

I would really welcome contributions from other people:

• I have a fairly narrow focus in what I want to do with the XML so my tools discard potentially useful information.
• I am also not a native Python speaker — you can probably tell.
• Many of the people who want to use the machine readable specification are much more comfortable with functional languages — translations are most welcome.

So if you have a suggestion for improving the scripts or you want other scripts, feel free to implement your suggestion and send me a pull request.

Enjoy!

p.s., unpacking the tarballs and extracting the code is just the beginning. I am working with Cambridge University’s REMS research group to convert the ASL to their SAIL language from which you can generate O’Caml, LEM and HOL versions of the spec (with more backends planned).

And if the SAIL version does not suit your needs, then you might want want to know how to lex, parse, typecheck and execute ASL code yourself. I will describe those in future posts.

Written on April 29, 2017


text:
## anonymous 4 years ago What is the surface area of the composite figure? ~Attachment in comments~

1. anonymous

2. Shane_B

Take it in pieces and sum up the values at the end. It's going to be:$SA_{bottom}+4SA_{side}+4SA_{triangle~side}$

3. Shane_B

If you're stumped on this let me know and I'll walk you through it.

4. anonymous

It would help if you could walk me through it, please?

5. Shane_B

Ok, the bottom of the figure is a square with 6mm sides right? Well, the SA of a square is just side*side: $6mm*6mm=36mm^2$

6. Shane_B

The sides are rectangles so it's basically SA = LW:$7mm*6mm=42mm^2$

7. Shane_B

The top parts are just triangles with a 6mm base and a height of 4mm. The SA of a triangle is (1/2)bh:$\frac{(6mm)(4mm)}{2}=12mm^2$

8. Shane_B

Now use the first equation I posted which sums it all up to get the total surface area. If you work it out I'll double-check your answer.

9. anonymous

For some reason I've got 90 mm^2 but that's not even close to one of the answers I have :/

10. Shane_B

I think I lost you...here:$SA_{total}=SA_{bottom}+4SA_{side}+4SA_{triangle~side}$$SA_{total}=36+4(42)+4(12)=?$

11. Shane_B

There's no magic formula when doing these types of problems. You just take the individual areas and sum them up at the end.

12. anonymous

252 mm^2?

13. Shane_B

Yes

14. anonymous

Thank you!

15. Shane_B

yw, good luck :)

Find more explanations on OpenStudy


text:
# How to close the room which you own

I eventually opened a chat room in the wrong way and now I would like to close it. I've tried to find a procedure to do it but I wasn't successful. Could you help me?

The room is here: http://chat.stackexchange.com/rooms/1026/discussion-between

• It might be helpful if you included a link to the chat room you opened "in the wrong way". In case you can't close it yourself (I don't know if this is the case) a moderator could just go and close it without further ado. – t.b. Aug 9 '11 at 8:48
• @Theo: thank you for the useful comment. – Ilya Aug 9 '11 at 9:39

I deleted the room, only moderators should now be able to find it. I'm not sure if a room owner can do that (I think so, but I'm not sure). If you click on "room" on the right there should be an option "delete this room", if you have the rights to do that.

Rooms will exist indefinitely, so long as there is at least one person actively talking in the room. A room is considered worth retaining if it has more than 15 messages by at least 2 users. Rooms not worth retaining which are inactive for 7 days will be deleted. Rooms worth retaining which are inactive for 14 days will be frozen. Frozen rooms do not allow any new messages to be sent, and are not shown in the default room list to prevent cluttering the rooms interface.

So the room would have been automatically deleted after 7 days if nobody writes in it.

• thank you. Are you a moderator? – Ilya Aug 9 '11 at 13:35
• @Gortaur on a different SE site, not on Math. But all SE 2.0 site moderators are moderators on chat.stackexchange.com – Mad Scientist Aug 9 '11 at 13:48
• I understand. thank's again for the help. – Ilya Aug 9 '11 at 13:55
• "Inactive chat rooms are frozen and deleted after a few days automatically if nobody writes in them." - I thought as much; now, with that in mind, along with the pestering of the software for extensive comment exchanges to be moved to a chatroom, I suppose these chatroom exchanges will also eventually be deleted? – J. M. is a poor mathematician Aug 11 '11 at 14:19
• @J.M. I added the exact criteria for auto-deletion, only rooms with less than 15 messages are deleted, all others are just frozen and still can be accessed. – Mad Scientist Aug 11 '11 at 14:30
• Thanks. $\text{}$ – J. M. is a poor mathematician Aug 11 '11 at 14:32


text:
## Quantum Walk on the Line

### Authors: Ashwin Nayak and Ashvin Vishwanath

ABSTRACT

Motivated by the immense success of random walk and Markov chain methods in the design of classical algorithms, we consider {\em quantum\/} walks on graphs. We analyse in detail the behaviour of unbiased quantum walk on the line, with the example of a typical walk, the Hadamard walk''. In particular, we show that after~$t$ time steps, the probability distribution on the line induced by the Hadamard walk is almost uniformly distributed over the interval~$[-t/\sqrt{2},\;t/\sqrt{2}]$. This implies that the same walk defined on the circle mixes in {\em linear\/} time. This is in direct contrast with the quadratic mixing time for the corresponding classical walk. We conclude by indicating how our techniques may be applied to more general graphs.

Paper Available at: ftp://dimacs.rutgers.edu/pub/dimacs/TechnicalReports/TechReports/2000/2000-43.ps.gz


text:
Ratio is comparing of two quantities or numbers. Simplifying the ratios means making the numbers smaller in ratios so as to make it easier to compare. Simplifying ratios is nothing but reducing the ratio into its simplest form. Our calculator simplify the ratios into simplest form.

## How to Simplify Ratios

Below you could see the steps:

Step 1: Write down the factors of numerator and denominator.

Step 2: Find the greatest common factors of both numerator and denominator.

Step 3: Now, divide the numerator and denominator by that greatest common factor.

Here are some examples of simplifying ratios

### Solved Examples

Question 1: Simplify 15 : 9
Solution:
Given, ratio = 15 : 9

Factors of 15 = 1, 3, 5, 15

Factors of 9 = 1, 3, 9

Greatest Common Factor (G.C.D) = 3

dividing by G.C.D,   $15 \div 3 = 5$

$9 \div 3 = 3$

Ratio in simplest form = 5 : 3

Question 2: Simplify 8 : 36
Solution:
Given, ratio = 8 : 36

Factors of 8 = 1, 2, 4, 8

Factors of 36 = 1, 2, 3, 4, 6, 9, 12, 18 ,36

Greatest Common Factor (G.C.D) = 4

dividing by G.C.D,    $8 \div 4 = 2$

$36 \div 4 = 9$

Ratio in simplest form = 2 : 9

### Equivalent Ratio Calculator

 ratio simplifier math ratio calculator ratio to fraction calculator simplest form calculator unit rate calculator