text:
# Constraints on type parameters (C# Programming Guide)

Constraints inform the compiler about the capabilities a type argument must have. Without any constraints, the type argument could be any type. The compiler can only assume the members of System.Object, which is the ultimate base class for any .NET type. For more information, see Why use constraints. If client code tries to instantiate your class by using a type that is not allowed by a constraint, the result is a compile-time error. Constraints are specified by using the where contextual keyword. The following table lists the seven types of constraints:

Constraint Description
where T : struct The type argument must be a non-nullable value type. For information about nullable value types, see Nullable value types. Because all value types have an accessible parameterless constructor, the struct constraint implies the new() constraint and can't be combined with the new() constraint. You also cannot combine the struct constraint with the unmanaged constraint.
where T : class The type argument must be a reference type. This constraint applies also to any class, interface, delegate, or array type.
where T : notnull The type argument must be a non-nullable type. The argument can be a non-nullable reference type in C# 8.0 or later, or a not nullable value type. This constraint applies also to any class, interface, delegate, or array type.
where T : unmanaged The type argument must be a non-nullable unmanaged type. The unmanaged constraint implies the struct constraint and can't be combined with either the struct or new() constraints.
where T : new() The type argument must have a public parameterless constructor. When used together with other constraints, the new() constraint must be specified last. The new() constraint can't be combined with the struct and unmanaged constraints.
where T : <base class name> The type argument must be or derive from the specified base class.
where T : <interface name> The type argument must be or implement the specified interface. Multiple interface constraints can be specified. The constraining interface can also be generic.
where T : U The type argument supplied for T must be or derive from the argument supplied for U.

## Why use constraints

By constraining the type parameter, you increase the number of allowable operations and method calls to those supported by the constraining type and all types in its inheritance hierarchy. When you design generic classes or methods, if you'll be performing any operation on the generic members beyond simple assignment or calling any methods not supported by System.Object, you'll have to apply constraints to the type parameter. For example, the base class constraint tells the compiler that only objects of this type or derived from this type will be used as type arguments. Once the compiler has this guarantee, it can allow methods of that type to be called in the generic class. The following code example demonstrates the functionality you can add to the GenericList<T> class (in Introduction to Generics) by applying a base class constraint.

public class Employee
{
public Employee(string s, int i) => (Name, ID) = (s, i);
public string Name { get; set; }
public int ID { get; set; }
}

public class GenericList<T> where T : Employee
{
private class Node
{
public Node(T t) => (Next, Data) = (null, t);

public Node Next { get; set; }
public T Data { get; set; }
}

{
Node n = new Node(t) { Next = head };
}

public IEnumerator<T> GetEnumerator()
{

while (current != null)
{
yield return current.Data;
current = current.Next;
}
}

public T FindFirstOccurrence(string s)
{
T t = null;

while (current != null)
{
if (current.Data.Name == s)
{
t = current.Data;
break;
}
else
{
current = current.Next;
}
}
return t;
}
}

The constraint enables the generic class to use the Employee.Name property. The constraint specifies that all items of type T are guaranteed to be either an Employee object or an object that inherits from Employee.

Multiple constraints can be applied to the same type parameter, and the constraints themselves can be generic types, as follows:

class EmployeeList<T> where T : Employee, IEmployee, System.IComparable<T>, new()
{
// ...
}

When applying the where T : class constraint, avoid the == and != operators on the type parameter because these operators will test for reference identity only, not for value equality. This behavior occurs even if these operators are overloaded in a type that is used as an argument. The following code illustrates this point; the output is false even though the String class overloads the == operator.

public static void OpEqualsTest<T>(T s, T t) where T : class
{
System.Console.WriteLine(s == t);
}
private static void TestStringEquality()
{
string s1 = "target";
System.Text.StringBuilder sb = new System.Text.StringBuilder("target");
string s2 = sb.ToString();
OpEqualsTest<string>(s1, s2);
}

The compiler only knows that T is a reference type at compile time and must use the default operators that are valid for all reference types. If you must test for value equality, the recommended way is to also apply the where T : IEquatable<T> or where T : IComparable<T> constraint and implement the interface in any class that will be used to construct the generic class.

## Constraining multiple parameters

You can apply constraints to multiple parameters, and multiple constraints to a single parameter, as shown in the following example:

class Base { }
class Test<T, U>
where U : struct
where T : Base, new()
{ }

## Unbounded type parameters

Type parameters that have no constraints, such as T in public class SampleClass<T>{}, are called unbounded type parameters. Unbounded type parameters have the following rules:

• The != and == operators can't be used because there's no guarantee that the concrete type argument will support these operators.
• They can be converted to and from System.Object or explicitly converted to any interface type.
• You can compare them to null. If an unbounded parameter is compared to null, the comparison will always return false if the type argument is a value type.

## Type parameters as constraints

The use of a generic type parameter as a constraint is useful when a member function with its own type parameter has to constrain that parameter to the type parameter of the containing type, as shown in the following example:

public class List<T>
{
public void Add<U>(List<U> items) where U : T {/*...*/}
}

In the previous example, T is a type constraint in the context of the Add method, and an unbounded type parameter in the context of the List class.

Type parameters can also be used as constraints in generic class definitions. The type parameter must be declared within the angle brackets together with any other type parameters:

//Type parameter V is used as a type constraint.
public class SampleClass<T, U, V> where T : V { }

The usefulness of type parameters as constraints with generic classes is limited because the compiler can assume nothing about the type parameter except that it derives from System.Object. Use type parameters as constraints on generic classes in scenarios in which you want to enforce an inheritance relationship between two type parameters.

## NotNull constraint

Beginning with C# 8.0, you can use the notnull constraint to specify that the type argument must be a non-nullable value type or non-nullable reference type. The notnull constraint can only be used in a nullable enable context. The compiler generates a warning if you add the notnull constraint in a nullable oblivious context.

Unlike other constraints, when a type argument violates the notnull constraint, the compiler generates a warning when that code is compiled in a nullable enable context. If the code is compiled in a nullable oblivious context, the compiler doesn't generate any warnings or errors.

## Unmanaged constraint

Beginning with C# 7.3, you can use the unmanaged constraint to specify that the type parameter must be a non-nullable unmanaged type. The unmanaged constraint enables you to write reusable routines to work with types that can be manipulated as blocks of memory, as shown in the following example:

unsafe public static byte[] ToByteArray<T>(this T argument) where T : unmanaged
{
var size = sizeof(T);
var result = new Byte[size];
Byte* p = (byte*)&argument;
for (var i = 0; i < size; i++)
result[i] = *p++;
return result;
}

The preceding method must be compiled in an unsafe context because it uses the sizeof operator on a type not known to be a built-in type. Without the unmanaged constraint, the sizeof operator is unavailable.

The unmanaged constraint implies the struct constraint and can't be combined with it. Because the struct constraint implies the new() constraint, the unmanaged constraint can't be combined with the new() constraint as well.

## Delegate constraints

Also beginning with C# 7.3, you can use System.Delegate or System.MulticastDelegate as a base class constraint. The CLR always allowed this constraint, but the C# language disallowed it. The System.Delegate constraint enables you to write code that works with delegates in a type-safe manner. The following code defines an extension method that combines two delegates provided they're the same type:

public static TDelegate TypeSafeCombine<TDelegate>(this TDelegate source, TDelegate target)
where TDelegate : System.Delegate
=> Delegate.Combine(source, target) as TDelegate;

You can use the above method to combine delegates that are the same type:

Action first = () => Console.WriteLine("this");
Action second = () => Console.WriteLine("that");

var combined = first.TypeSafeCombine(second);
combined();

Func<bool> test = () => true;
// Combine signature ensures combined delegates must
// have the same type.

If you uncomment the last line, it won't compile. Both first and test are delegate types, but they're different delegate types.

## Enum constraints

Beginning in C# 7.3, you can also specify the System.Enum type as a base class constraint. The CLR always allowed this constraint, but the C# language disallowed it. Generics using System.Enum provide type-safe programming to cache results from using the static methods in System.Enum. The following sample finds all the valid values for an enum type, and then builds a dictionary that maps those values to its string representation.

public static Dictionary<int, string> EnumNamedValues<T>() where T : System.Enum
{
var result = new Dictionary<int, string>();
var values = Enum.GetValues(typeof(T));

foreach (int item in values)
return result;
}

The methods used to make use of reflection, which has performance implications. You can call this method to build a collection that is cached and reused rather than repeating the calls that require reflection.

You could use it as shown in the following sample to create an enum and build a dictionary of its values and names:

enum Rainbow
{
Red,
Orange,
Yellow,
Green,
Blue,
Indigo,
Violet
}

var map = EnumNamedValues<Rainbow>();

foreach (var pair in map)
Console.WriteLine(\$"{pair.Key}:\t{pair.Value}");


text:
# Contour Plots

This tutorial introduces contour plots, and how to plot them in ggplot2.

# What is a contour plot?

Suppose you have a map of a mountainous region. How might you indicate elevation on that map, so that you get to see the shape of the landscape?

The idea is to use contour lines, which are curves that indicate a constant height.

Imagine cutting the tops of the mountains off by removing all land above, say, 900 meters altitude. Then trace (on your map) the shapes formed by the new (flat) mountain tops. These curves are contour lines. Choose a differential such as 50 meters, and draw these curves for altitudes …800m, 850m, 900m, 950m, 1000m, … – the result is a contour plot (or topographic map, if it’s a map).

In general, contour plots are useful for functions of two variables (like a bivariate gaussian density).

We’ll look at examples in the next section.

Notes on contours:

• They never cross.
• The steepest slope at a point is parallel to the contour line.
• They aren’t entirely ambiguous. For example, you can’t tell whether or not the mountains are actually mountains, or whether they’re holes/valleys! Sometimes you can add colour to indicate depth; other times (like in topographic maps) you can indicate elevation directly as numbers beside contour lines. Other times, this is not required, because the context makes it obvious.

# Contour plots in ggplot2

There are two ways you can make contour plots in ggplot2 – but they’re both for quite different purposes.

## Method 1: Approximate a bivariate density

This method approximates a bivariate density from data.

First, recall how this is done in the univariate case. A little kernel function (like a shrunken bell curve) is placed over each data point, and these are added together to get a density estimate:

library(ggplot2)
## Warning: package 'ggplot2' was built under R version 3.5.2
set.seed(373)
x <- rnorm(1000)
ggplot(data.frame(x=x), aes(x)) +
geom_density()

We can do the same thing to get a bivariate density, except with little bivariate kernel functions (like shrunken bivariate Gaussian densities). But, we can’t just simply put “density height” on the vertical axis – we need that for the second dimension. Instead, we can use contour plots.

This is the contour plot that ggplot2’s geom_density2d() does: builds a bivariate kernel density estimate (based on data), then makes a contour plot out of it:

y <- rnorm(1000)
ggplot(data.frame(x=x, y=y), aes(x, y)) +
geom_density2d()

Based on context (this is a density), we know that this is a “hill” and not a “hole”. If you were to start at some point at the “bottom” of the hill, the steepest way up would be perpendicular to the contours. The highest point on the hill is within the middle-most circle.

## Method 2: General Contour Plots

You can also make contour plots that aren’t a kernel density estimate (necessarily), using geom_contour(). This is based off of any bivariate function.

### Basics

Suppose we want to make a contour plot of the bivariate function $f(x,y) = x^2 + sin(y)$ over the rectangle $$-2<x<2$$ and $$-5<y<5$$. First, make a grid over the rectangle (it must be a grid – geom_contour() won’t work otherwise). Then, evaluate the function at each of the grid points. Put all this info into a single data frame with three columns (two for the $$x$$ and $$y$$ coordinates, and one for the function evaluation). Then, indicate the function evaluation in geom_contour() as the aesthetic z, and the x and y aesthetics are as usual.

f <- function(x) x[1]^2 + sin(x[2])
x <- seq(-2, 2, length.out=100)
y <- seq(-5, 5, length.out=100)
dat <- expand.grid(x=x, y=y)  # Data frame of 100*100=10000 points.
dat$z <- apply(dat, 1, f) ggplot(dat, aes(x, y)) + geom_contour(aes(z=z)) Notice that expand.grid is useful for making grids. It returns all pairs from the input vectors. But, this also means that it’s easy for the output to explode! Note that finer grids yield plots with higher accuracy. Here’s an example of a rough grid, whose contours are jagged: f <- function(x) x[1]^2 + sin(x[2]) x <- seq(-2, 2, length.out=10) y <- seq(-5, 5, length.out=10) dat <- expand.grid(x=x, y=y) # Data frame of 10*10=100 points. dat$z <- apply(dat, 1, f)
ggplot(dat, aes(x, y)) +
geom_contour(aes(z=z))

Here, we’ll look at colouring the plots, and adding more/less contours.

Here’s another example, with the volcano data (a matrix of altitudes for a volcano). If you’d like, first take a look at a 3D rendering of the volcano, by running the following code chunk in your R console after un-commenting the last two lines (code taken directly from rgl’s surface3d() documentation):

data(volcano)
z <- 2 * volcano        # Exaggerate the relief
x <- 10 * (1:nrow(z))   # 10 meter spacing (S to N)
y <- 10 * (1:ncol(z))   # 10 meter spacing (E to W)
zlim <- range(y)
zlen <- zlim[2] - zlim[1] + 1
colorlut <- terrain.colors(zlen) # height color lookup table
col <- colorlut[ z - zlim[1] + 1 ] # assign colors to heights for each point
# open3d()
# surface3d(x, y, z, color = col, back = "lines")

Feel free to move the image around by clicking and dragging. Neat, eh?

We’ll make a contour plot with this.

dat <- expand.grid(x=x, y=y)
dat$z <- as.vector(z)/2 # "De-exaggerate" the relief ggplot(dat, aes(x, y)) + geom_contour(aes(z=z)) + xlab("") + ylab("") + theme(axis.text=element_blank(), axis.ticks=element_blank()) But, you can’t tell that the inner circles actually represent a hole (a caldera), not a peak. Let’s add colour by indicating the “variable” ..height.. in the colour aesthetic of geom_cotour(), which will also indicate height as a legend: dat <- expand.grid(x=x, y=y) dat$z <- as.vector(z)/2   # "De-exaggerate" the relief
ggplot(dat, aes(x, y)) +
geom_contour(aes(z=z, colour=..level..)) +
xlab("") + ylab("") +
theme(axis.text=element_blank(),
axis.ticks=element_blank()) +
scale_color_continuous("Altitude")

Now we can tell that the highest point is within the lightest blue area, to the left of the caldera.

Now let’s add more contour lines, to get a better sense of the terrain. Do so by indicating the altitudes to make contours for via breaks. Let’s make 5 unit spacing:

dat <- expand.grid(x=x, y=y)
dat\$z <- as.vector(z)/2   # "De-exaggerate" the relief
ggplot(dat, aes(x, y)) +
geom_contour(aes(z=z, colour=..level..),
breaks=seq(100, 200, by=5)) +
xlab("") + ylab("") +
theme(axis.text=element_blank(),
axis.ticks=element_blank()) +
scale_color_continuous("Altitude")

Although you can change the contours, it’s best practice to keep the (height) spacing between contour lines equal – otherwise, the contour plot becomes harder to read. In the above plot, for example, we know that crossing $$n$$ contour lines (that are either increasing or decreasing) results in $$5n$$ units of elevation gain/loss, because the spacing between contours is always 5 units.

##### Vincenzo Coia
###### he/him/his 🌈 👨

I’m a data scientist at the University of British Columbia, Vancouver.

format: plain


text:
# Noise amplification with inverse filtering

I'm trying to gain a better (mathematical) understanding of why inverse filtering is almost never the solution for correcting an image. From what I understand, we start with a discrete signal $$s[n]$$ that is the result of the true image $$y[n]$$ convolved by some kernel $$A$$ with some added noise $$w[n]$$. For discrete signals, this be converted to a matrix equation $$s = Ay + w$$, where $$A$$ is a circulant matrix representing the convolution. In Fourier Space, we have $$s[f] = A[f]y[f] + w[f]$$ which is much simpler.

Now, if we assume we know the kernel and its inverse exists, then we can approximately recover the true signal $$y$$ by inversion : $$A^{-1} s = \hat s = y + A^{-1} w$$. The problem becomes clear in the Fourier space, where inversion then becomes division, and if $$A[f]$$ is $$0$$ or very small at several frequencies this can lead to noise amplification. I am trying to get a better picture of this in the matrix representation.

I want to see if I can measure the noise amplification in this representation by trying to figure out an upper bound on the norm of $$\hat s$$ but I'm not sure if I'm going about it the right way. Calculating the norm of $$\hat s$$ I have $$|| \hat s|| = ||y + A^{-1} w||$$ $$||\hat s|| \leq ||y|| + ||A^{-1}||~||w||$$ Am I correct in assuming that the upper bound on the noise amplification is the norm of the inverse of the kernel?

$$\frac{\text{Norm of noise after inverse filter}}{\text{Norm of noise before inverse filter}} \leq \frac{||\mathbf{A}^{-1}||*||\mathbf{w}||}{||\mathbf{w}||}=||\mathbf{A}^{-1}||$$


text:
## Algebraic & Geometric Topology

### On the coarse geometry of certain right-angled Coxeter groups

#### Abstract

Let $Γ$ be a connected, triangle-free, planar graph with at least five vertices that has no separating vertices or edges. If the graph $Γ$ is $CℱS$, we prove that the right-angled Coxeter group $GΓ$ is virtually a Seifert manifold group or virtually a graph manifold group and we give a complete quasi-isometry classification of these groups. Furthermore, we prove that $GΓ$ is hyperbolic relative to a collection of $CℱS$ right-angled Coxeter subgroups of $GΓ$. Consequently, the divergence of $GΓ$ is linear, quadratic or exponential. We also generalize right-angled Coxeter groups which are virtually graph manifold groups to certain high-dimensional right-angled Coxeter groups (our families exist in every dimension) and study the coarse geometry of this collection. We prove that strongly quasiconvex, torsion-free, infinite-index subgroups in certain graph of groups are free and we apply this result to our right-angled Coxeter groups.

#### Article information

Source
Algebr. Geom. Topol., Volume 19, Number 6 (2019), 3075-3118.

Dates
Revised: 31 December 2018
Accepted: 3 March 2019
First available in Project Euclid: 29 October 2019

https://projecteuclid.org/euclid.agt/1572314550

Digital Object Identifier
doi:10.2140/agt.2019.19.3075

Mathematical Reviews number (MathSciNet)
MR4023336

Zentralblatt MATH identifier
07142626

#### Citation

Nguyen, Hoang Thanh; Tran, Hung Cong. On the coarse geometry of certain right-angled Coxeter groups. Algebr. Geom. Topol. 19 (2019), no. 6, 3075--3118. doi:10.2140/agt.2019.19.3075. https://projecteuclid.org/euclid.agt/1572314550

#### References

• J Behrstock, A counterexample to questions about boundaries, stability, and commensurability, preprint (2017)
• J Behrstock, R Charney, Divergence and quasimorphisms of right-angled Artin groups, Math. Ann. 352 (2012) 339–356
• J Behrstock, C Dru\commaaccenttu, Divergence, thick groups, and short conjugators, Illinois J. Math. 58 (2014) 939–980
• J Behrstock, C Dru\commaaccenttu, L Mosher, Thick metric spaces, relative hyperbolicity, and quasi-isometric rigidity, Math. Ann. 344 (2009) 543–595
• J Behrstock, M F Hagen, A Sisto, Thickness, relative hyperbolicity, and randomness in Coxeter groups, Algebr. Geom. Topol. 17 (2017) 705–740
• J A Behrstock, T Januszkiewicz, W D Neumann, Quasi-isometric classification of some high dimensional right-angled Artin groups, Groups Geom. Dyn. 4 (2010) 681–692
• J A Behrstock, W D Neumann, Quasi-isometric classification of graph manifold groups, Duke Math. J. 141 (2008) 217–240
• P-E Caprace, Buildings with isolated subspaces and relatively hyperbolic Coxeter groups, Innov. Incidence Geom. 10 (2009) 15–31 Corrrection in 14 (2015) 77–79
• R Charney, H Sultan, Contracting boundaries of $\rm CAT(0)$ spaces, J. Topol. 8 (2015) 93–117
• M Cordes, Morse boundaries of proper geodesic metric spaces, Groups Geom. Dyn. 11 (2017) 1281–1306
• M Cordes, D Hume, Stability and the Morse boundary, J. Lond. Math. Soc. 95 (2017) 963–988
• P Dani, E Stark, A Thomas, Commensurability for certain right-angled Coxeter groups and geometric amalgams of free groups, Groups Geom. Dyn. 12 (2018) 1273–1341
• P Dani, A Thomas, Divergence in right-angled Coxeter groups, Trans. Amer. Math. Soc. 367 (2015) 3549–3577
• P Dani, A Thomas, Bowditch's JSJ tree and the quasi-isometry classification of certain Coxeter groups, J. Topol. 10 (2017) 1066–1106
• M W Davis, The geometry and topology of Coxeter groups, London Mathematical Society Monographs Series 32, Princeton Univ. Press (2008)
• M W Davis, T Januszkiewicz, Right-angled Artin groups are commensurable with right-angled Coxeter groups, J. Pure Appl. Algebra 153 (2000) 229–235
• M W Davis, B Okun, Vanishing theorems and conjectures for the $\ell^2$–homology of right-angled Coxeter groups, Geom. Topol. 5 (2001) 7–74
• C Dru\commaaccenttu, M Sapir, Tree-graded spaces and asymptotic cones of groups, Topology 44 (2005) 959–1058
• M G Durham, S J Taylor, Convex cocompactness and stability in mapping class groups, Algebr. Geom. Topol. 15 (2015) 2839–2859
• A Genevois, Hyperbolicities in $\mathrm{CAT}(0)$ cube complexes, preprint (2017)
• S M Gersten, Divergence in $3$–manifold groups, Geom. Funct. Anal. 4 (1994) 633–647
• S M Gersten, Quadratic divergence of geodesics in ${\rm CAT}(0)$ spaces, Geom. Funct. Anal. 4 (1994) 37–51
• C M Gordon, Artin groups, $3$–manifolds and coherence, Bol. Soc. Mat. Mexicana 10 (2004) 193–198
• M Haulmark, H T Nguyen, H C Tran, On the relative hyperbolicity and manifold structure of certain right-angled Coxeter groups, preprint (2017)
• M Kapovich, B Leeb, $3$–Manifold groups and nonpositive curvature, Geom. Funct. Anal. 8 (1998) 841–852
• H Kim, Stable subgroups and Morse subgroups in mapping class groups, Internat. J. Algebra Comput. 29 (2019) 893–903
• I Levcovitz, Divergence of $\rm CAT(0)$ cube complexes and Coxeter groups, Algebr. Geom. Topol. 18 (2018) 1633–1673
• J Russell, D Spriano, H C Tran, Convexity in hierarchically hyperbolic spaces, preprint (2018)
• A Sisto, On metric relative hyperbolicity, preprint (2012)
• H C Tran, Malnormality and join-free subgroups in right-angled Coxeter groups, preprint (2017)
• H C Tran, On strongly quasiconvex subgroups, Geom. Topol. 23 (2019) 1173–1235


text:
# Tag Info

13

If you are using an AES library that has not undergone the FIPS validation process, then you are not FIPS compliant (or, at least, your use of AES is not). FIPS compliant means more than "we use algorithms that FIPS likes", it means "having passed the FIPS certification process"; that is how NIST defines it. Sorry, but NIST is quite strict about this; if ...

5

FIPS 140-2 only certifies cryptographic modules, not entire systems. So, to tell if your system is 140-2 compliant, it must be using a 140-2 certified module. NIST publishes a list of all FIPS 140-2 certified cryptographic modules. It is important to remember, though, that 140-2 certification does not certify that the module is used in a secure manner. From ...

4

Q1: Why are these tests stroked out? These tests are stroked out on pages 57-58 of the current FIPS 140-2 because they are no longer part of the current FIPS 140-2 standard, since Change Notice 2 of 2002 December third, where these pages belong. My guess for the rationale of removing these tests is that It was realized that the very principle ...

4

Take a look at FIPS 140-2 Annex A. It lists the following: Symmetric Key AES, Triple-DES, Escrowed Encryption Standard Asymmetric Key DSA, RSA, ECDSA Hash Standards SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256 Random number generators See annex c Message authentication CCM, GCM, GMAC, CMAC, HMAC

3

No you don't need to use an IV. However, this limits you to ECB mode only — the only one which doesn't use an IV — and your CAVP (Cryptographic Algorithm Validation Program) AES certificate will indicate so.

3

I can't help you with your Windows question, however I can chime in on FIPS: Is it going to be FIPS 140-2 compliant? It might not be. The problem is the "SHA1 for hashing"; SHA1 is no longer approved as a collision resistant hash function. On the other hand, HMAC-SHA1 is still approved as a Message Authentication Code. That is, if you are using SHA1 ...

3

No, there isn't. There are too many different systems out there to make a generic tool.

3

This page gives details of a successful extraction of a 3DES key from an IBM 4758 (FIPS 140-1 Level 4): http://www.cl.cam.ac.uk/~rnc1/descrack/. In summary, it required 20 mins of access to the device, 2 days of (offline) cracking time, and about $1000 in equipment. Not sure if this quite answers the question you were asking in that it relies on ... 3 FIPS 140-2 Security Level 2 does not require any form of security measure to prevent extraction of secrets. It simply requires tamper evidence, that is, it should be possible to notice that such attack took place by looking (for instance) at some seal on the device or at a log file. To answer your question, extracting a secret may therefore take 0 seconds ... 2 The current list of FIPS-approved cryptographical methods is here. For encryption, we're limited to AES, 3DES (known as TDEA in FIPS-speak), and EES (Skipjack). As for signing algorithms, we have RSA, DSA and ECDSA. Note that the list of FIPS-approved algorithms does change at times; not extremely frequently, but more often than they come out with a new ... 2 You cannot tell anything related to FIPS 140 by looking at a key or by looking at a file. FIPS 140 doesn't say anything about the choice of encryption algorithm, other than requiring that all every encryption algorithm must be “approved security function” (as defined in the glossary) and there must be at least 1. FIPS 140 is all about the module, i.e. the ... 2 Actually, it's there on the list, just with a different name -- the approved algorithm you want is listed as "SHS" (Secure Hashing Standard). Now, the term "SHS" doesn't distinguish between the various flavors of SHA-2 (and SHA-1, which is still approved for some uses); however if you look at this more detailed list, that gives details on what vendors have ... 2 The rationale for no longer mandating these tests include: These tests are generally not useful against most FIPS 140-2 approved random number generators. These tests can be useful against some kind of entropy sources. These tests give frequent false positives every few thousandth block of truely random stream will fail the test. Some entropy sources are ... 2 It is possible to have product based on this algorithm suite, which is FIPS 140-2 compliant. However, there are special considerations for use of SHA-1 and RSA. The algorithm suite is partially considered obsolete and not FIPS 140-2 approved. For information on NIST transition to 112 bit cryptography you can read G.14 at FIPS 140-2 Implementation ... 2 Yes, a device that is FIPS certified need not be restricted to using only FIPS-approved algorithms. For example, in your case, FIPS has no problems with you supporting Curve25519, as long as the user can turn it off. That is, the device will need to be able to be set in a mode that it performs only FIPS approved algorithms (and the FIPS approval ... 1 The generated private key is same for both client and server is it true? No, that's not true. The key pairs and thus the private keys will be different. They will only be the same if the random number generator creates 521 identical bits for both the server and the client when the key pairs are generated. Client send its public key first or Server? ... 1 Please refer the document at NIST site pointing to the document (800-22-rev 1a ) updated on April 2010 (http://csrc.nist.gov/publications/nistpubs/800-22-rev1a/SP800-22rev1a.pdf). The list of special published (SP) documents are available at (http://csrc.nist.gov/publications/PubsSPs.html) It involves some reading, but should get your answers. Since it ... 1 FIPS 140-2 specifies conditions applicable to the environment of RSA (and other) key generation, and refers to FIPS 186-4 for the generation itself. Several recent Java Card Smart Cards can internally generate RSA-2048 key pairs per FIPS 186-4, with security policy and FIPS 140-2 level 3 certificate to attest that. Here is the one on top of the list at time ... 1 Foreword atsec IT security blog recently commented about FIPS and NIST rules with: "As technology moves on, and the pace of change increases, with no real update to the specification for a decade, FIPS 140-2 is creaking badly. To deal with this, the CMVP must issue Implementation Guidance (I.G.), which is now so complex that it is virtually impossible to ... 1 Be very aware that "FIPS 140-2 Compliance" is misleading, and usually irrelevant. To be compliant just means that your software uses a FIPS 140-2 Certified cryptographic module, and getting your software certified costs anywhere from$20-200k and takes 6-18 months. Just because your system passes the self-tests and statistical checks mandated by the standard ...

1

This requirement is a part of the general "continuous tests", and as such it's primary purpose is to detect "flatline" failures (if you can torture that analogy into making sense). Remember that FIPS-140 was originally written with hardware implementations in mind, so the approaches they take for testing sometimes seem odd for software since hardware ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# Water and electricity? Hot or Cold?

Is hot water or cold water more conductive for electricity or is it the same regardless?

• i.stack.imgur.com/Lvx3j.png – user42744 Mar 31 '14 at 21:36
• Electricity doesn't have conductivity, materials do. – jinawee Mar 31 '14 at 21:50

The electrical conductivity of the water depends on the water temperature : the higher the temperature, the higher the electrical conductivity would be. The electrical conductivity of water increases by 2-3% for an increase of 1 degree Celsius of water temperature. Many EC meters nowadays automatically standardize the readings to 25$^{\circ}$C.

While the electrical conductivity is a good indicator of the total salinity, it still does not provide any information about the ion composition in the water.

The same electrical conductivity values can be measured in low quality water (e.g. water rich with Sodium, Boron and Fluorides) as well as in high quality irrigation water (e.g. adequately fertilized water with appropriate nutrient concentrations and ratios).

http://www.smart-fertilizer.com/articles/electrical-conductivity

Hot water is more conductive than cold water.

• Welcome to the site! We expect answers here to back up their assertions with appropriate arguments and references; could you elaborate some more on this? – Emilio Pisanty Apr 1 '14 at 14:28

Hot water is not a good conductor of electricity because when water is heated it becomes less impure because of which it dissociates less ions and hence conducts less electricity than cold water

• Welcome to Physics SE :) Can you state your idea a bit more clearly, maybe explaining it more in detail? As it is, I am having trouble understanding what exactly you mean. – Sanya Dec 14 '16 at 12:12
• When water is heated, the process of evaporation takes place because of which water gets purified so it is left with less ions to carry electricity. Because of which it conducts electricity but not better than cold water – Priyanka Dec 14 '16 at 14:57
• It doesn't matter that the water is cold or hot............. The conduction is same – Priyanka Dec 15 '16 at 13:49
• According to empirical steam tables, water becomes highly conductive at superheated levels and there is evidence that when water is super-cooled it becomes equally conductive as the crystalline structure changes to Rhombic from ortho-rhombic – Rhodie Feb 26 at 2:05


text:
539 views
The number of binary min. heaps that can be formed from a set of 7 distinct integers is _________?
asked in DS | 539 views
aPPROACH GIVEN IN ABOVE LINK IS DIFFERENT FROM YOURS RIGHT ?

Why have you multiplied 4! * 2 !  didnt understand this part in ur explanation
answer given is 80 donno how even i got 48
Yes @target2017

There are more possibilities.
@gateset @jithin see my ans bellow....
yes I got it thank u so much great explanation :)

• Pick any $7$ distinct  integers and sort it .
• After sorting, pick the minimum element and make it the root of the min heap. So, there is only $1$ way to make the root of the min heap.
• Now we are left with $6$ elements.
• Total ways to design a min heap from $6$ elements = $C(6,3) * 2! * C(3,3) * 2!$ = $80$

$C(6,3) * 2!$ :- Pick up any $3$ elements for the left subtree and each left subtree combination can be permuted in $2!$ ways by interchanging the children and similarly, for right subtree .

How many min heaps for $N = 15$ elements ?

• Pick any $15$ distinct  integers and sort it .
• After sorting, pick the minimum element and make it the root of the min heap. So, there is only $1$ way to make the root of the min heap.
• Now we are left with $14$ elements.
• Total ways to design a min heap from $14$ elements

=> $C(14,7) * \left ( C(6,3) * 2! * C(3,3) * 2! \right ) * C(7,7) * \left ( C(6,3) * 2! * C(3,3) * 2! \right )$

$C(14,7) * \left ( C(6,3) * 2! * C(3,3) * 2! \right )$ :- Pick up any $7$ elements for the left subtree and fix the root. Now, we are left with $6$ elements and using the same procedure for above problem, take each left subtree combination can be permuted in $2!$ ways by interchanging the children and similarly, for right subtree .

selected by
Any signififance of C(6,3) in general case ?

ie in n = N  then
C((N-1) , (N-1)/2 ) * 2!  * C((N-1)/2 , (N-1)/2 )   when n is odd  . Can i generalize like this ?
Yes, some generalization is there . I've edited. You can check now !!
What if N is EVEN ?
Well, same logic. Basic idea is to design a complete binary tree and everything will be the same .

for n=7

for n=8

Right @pC :)
How do you calculate for n=5 @Kapil Veteran
Can you try and tell me ? Logic above remains the same .
Yes,got it.initially i thought that i should divide the n-1 integers into two halves,but later i found out the property of heap.So,i got it now.Answer was great but it would be more helpful if you have also added how to divide n-1 integers into L and R.Thanks again for the answer :)

for n=5

n-1=4

here by heap property L=3 and R=1

So,f(5)=4C3 * f(3) * f(1)

Here i m generalizing it with an  example....
suppose i have a min heap like this

assume root at level zero hight of this heap is k=3
The smallest element has to be placed at the root of the heap.  After that we split up the remaining elements into the two subtrees and recursively compute the number of binary heaps that they can make.  The trickiest part here is that the two subtrees don't have necessarily have the same number of nodes (unless N is 1 less than a power of two).

We fill the tree in breadth first order which means that nodes in the lowest level will go to the left subtree first and then any excess nodes will be in the right subtree.
suppose that at last level there r m nodes nd total nodes=n
hence n=2k-1 +m
in above tree k=3 m=7 so n=2k-1 +m=8-1+7=14
or we can say that m=n-2k+1
now calculate number of elements in the left subtree as L ?
we now that before last level every level is complete and nodes r equally distributed into left subtree nd .right subtree.
so no of nodes befor last level in  left subtree or.right subtree.=p
now we know that befor last level total nodes=2k-1 now leave root now total nodes=2k-2
these total nodes 2k-2, is equally distributed into left subtree nd .right subtree.
hence p=(2k-2)/2=2k-1 -1
now suppose number of elements in the left subtree as L and number of elements in the right subtree as L
L=p+min(2k-1,m )        R=p+max(0,m-2k-1)
expalanation for  L=p+min(2k-1,m )        R=p+max(0,m-2k-1)
For L=p+min(2k-1,m )        R=p+max(0,m-2k-1
there r 2 cases
case-1
if our lst part is not complete then it ll surely have m elements in left sub tre part=no of nodes at last level so if all nodes at last level comes in lst part so there r o nodes in rst part it gives
L=p+min(   ,m )        R=p+max(0,   )
case 2
if our lst part is  complete nd there r some nodes also in rst part
so for lst part 2k/2=2k-1 nodes in lst part at last level nd rest nodes out of m ie m-2k-1 will be on rst part at last level
L=p+min(2k-1,    )        R=p+max(   ,m-2k-1
now by cobining case 1&2
L=p+min(2k-1,m )        R=p+max(0,m-2k-1)

Returning to the original problem you can calculate f(n), the number of binary heaps with n distinct elements, as f(n)
f(0)=1, f(1)=1
f(n)=n-1CLf(L)f(R)
this is generating series (1, 1, 1, 2, 3, 8, 20, 80, 210, 896, 3360, 19200, 79200, 506880, 2745600)
http://oeis.org/A056971
f(7)=80

----------------------------------------------------------------------------------------------------------------------------------------------------------------
if we have our min heap as complete binary tree then this method makes it mor simpler bcoz for a complete binary tree for every node its left sub tree nd right sub tree  is also complete binary tree with same no of nodes in lst and rst  nd they have also same no of binary min heaps means f(L)=f(R)
suppose n=15 means it is complete as 24-1=15, k=3
L=R=2k-1=7
f(15)=14c7 *(f(7))2
f(7)=6c3*(f(3))2
f(3)=2c1*(f(1))2
f(1)=1

edited
Thank you so much :)
if u have little bit doubt also u can ask
btw i m nt sir.... :)

How you got
L=p+min(2k-1,m )        R=p+max(0,m-2k-1)

Equation ?

I understood upto p=(2k-2)/2=2k-1 -1 statement .

You could have explained it using the same example till the last  instead of that series . The traditional way just to understand this topic
This is such a nice explanation.

Thanks :)

For L=p+min(2k-1,m )        R=p+max(0,m-2k-1)
there r 2 cases
case-1
if our lst part is not complete then it ll surely have m elements in left sub tre part=no of nodes at last level so if all nodes at last level comes in lst part so there r o nodes in rst part it gives
L=p+min(   ,m )        R=p+max(0,   )
case 2
if our lst part is  complete nd there r some nodes also in rst part
so for lst part 2k/2=2k-1 nodes in lst part at last level nd rest nodes out of m ie m-2k-1 will be on rst part at last level
L=p+min(2k-1,    )        R=p+max(   ,m-2k-1)
now by cobining case 1&2
L=p+min(2k-1,m )        R=p+max(0,m-2k-1)

how f(0) = 1?

+1 vote
1
+1 vote
2


text:
# Changing the height of a symbol

I would like to make a shorter version of $\sqcup$ to use as a symbol for a Turing machine if possible. The first picture is the height I would like it to be and the second is the default height.

-

One option, scaling down vertically the symbol:

\documentclass{article}
\usepackage{graphicx}

\newcommand\ssqcup{\scalebox{1}[.75]{$\sqcup$}}

\begin{document}

$\sqcup q_{2}\quad \ssqcup q_{2}$

\end{document}

-

One can reduce the vertical size; the scaling of the horizontal line will not be noticeable.

\documentclass{article}
\usepackage{amsmath,graphicx,bm}

\newcommand{\tsq}{%
\text{\resizebox{!}{.8ex}{$\bm{\sqcup}$}}%
}

\begin{document}
$\tsq q_2\mathtt{0}$
\end{document}

With \bm the symbol will be blacker.

If you don't need the symbol in subscripts or superscripts, omit the \text around the main body.

-


text:
## Search Results

• ### en Newtonian Motion

The term newtonian motion denotes motion at low speed compared to the speed of light in a flat space/time and the change in the movement...
• ### en Keppler System

The purpose of the first project was to simulate the movement of earth around the sun. Since the expected results are well known it is...
• ### en Elastic Collisions

In order to figure out the calculation error of the integration algorithm i it to a well known system as for example the elastic collision...


text:
## Introduction

Plasma is an ionised gas coupled with electromagnetic fields. It is ubiquitously found in nature, laboratories, and industries, for example, in black-hole accretion discs, jets, the Sun’s core, and solar wind, the Earth’s magnetosphere, and magnetic fusion plasma. Magnetic fusion plasma characterised by a strong confinement magnetic field (~5 T) has steep density and temperature gradients (~10 keV/m) sustained by external heating of microwave and neutral beam injections in existing fusion experimental devices, and by fusion-born alpha particles in future burning plasma experiments. The magnetic fusion plasma is a non-equilibrium open system, self-organised with transport processes via micro-instabilities and associated turbulence driven by the steep density and temperature gradients1. Turbulence in magnetic fusion plasma is regarded as a multi-scale problem involving wide temporal and spatial scales, from the radius of electron gyration (~0.1 mm) to that of ion gyration (~1 cm). The electron-scale and ion-scale turbulence were often analysed separately under the scale-separation assumption. Since large-scale eddies in ion-scale turbulence were often dominant, the conventional model was designed to reproduce ion-scale turbulent transport. However, recent gyrokinetic simulation studies revealed the existence of cross-scale interactions between electron-scale and ion-scale turbulence2,3,4,5,6,7,8. Comparisons with experiments in Alcator C-Mod and DIII-D tokamaks in the United States suggest that the multi-scale interactions are necessary to explain the heat fluxes measured in the experiments3 and play an important role in the near-future ITER device4. Latest campaigns in TCV, ASDEX Upgrade and JET tokamak devices in Switzerland, Germany and the United Kingdom also report that the electron-scale turbulence is responsible for a stiff dependence of electron heat flux against electron temperature gradient (ETG) in ion-heated plasma8. Electron-scale effects are important not only in tokamak core plasma but also in spherical tokamaks9,10,11 and tokamak edge plasma12,13. We note that there exists another class of multi-scale problems in fusion plasma, namely, interactions between ion-scale turbulence and device scale (~1 m) or meso-scale fluctuations14, which is beyond the scope of this work.

Beyond the existing devices, electron heating is expected to dominate in ITER. In particular for the pre-fusion power operation 1 (PFPO-1) phase, the central ratio of electron to ion temperature Te/Ti can be even larger than 3.0 by electron cyclotron heating15. Additionally, fusion-born alpha particles in burning plasma mainly heat electrons with keeping electron temperature Te higher than that of ions Ti. Due to the relaxation by ion-electron energy exchange, a reactor-relevant temperature ratio is considered around 1 < Te/Ti < 2. As the temperature ratio Te/Ti increases, ion-scale instabilities tend to be destabilised16,17, in contrast to electron-scale instabilities that tend to be stabilised18. Therefore, the extrapolation of multi-scale interactions toward future burning fusion plasma experiments is non-trivial. To improve the performance prediction of future fusion devices, it should be clarified whether the cross-scale interactions are needed to be considered for ITER-relevant electron heated plasma and future burning plasma at Te/Ti > 1.

Here, we address this problem by means of numerical simulations of multi-scale turbulence in high electron temperature tokamak plasma with electrons (e), deuterium (D) and tritium (T) fuel and helium (He) ash, mimicking future experiments on burning plasma. The turbulent transport process in magnetised plasma is well described by non-linear gyrokinetic theory19,20,21, which is widely used for the analyses of magnetic fusion plasma and is also applied to accretion-disc and solar-wind turbulence22 and auroral arc23. The massively parallel computation resolving from electron to ion gyroradius scales is carried out by the gyrokinetic Vlasov simulation code GKV24,25 on the Japanese national flagship supercomputer Fugaku. The time evolution of perturbed distribution functions and electromagnetic potential fluctuations in a tokamak magnetic configuration is solved based on the delta-f electromagnetic gyrokinetic equations in a five-dimensional phase space26. See “Methods” for the numerical model and employed plasma parameters.

## Results

### Micro-instabilities at ion and electron scales

In this simulation, two types of micro-instabilities can linearly grow with time because of steep electron temperature and density gradients. The first one is destabilised by toroidal precession resonance of electrons trapped in a weak magnetic field side, which is called the trapped electron mode (TEM)27. The other one is destabilised by the compression of the poloidal magnetic drift in torus magnetic curvature, which is named the toroidal ETG mode28. TEM typically possesses long wavelengths in the ion gyroradius scale and low frequencies, whereas the ETG typically has short wavelengths in the electron gyroradius scale and high frequencies. From the linear stability analysis (See Fig. 1), the poloidal wavenumber of the most unstable TEM is ky = 0.25 ρti−1 with the real frequency ωr = 1.50 vti/R0 and linear growth rate γ = 0.145 vti/R0, where ρti, vti and R0 are respectively the ion (the hydrogen mass is used as a reference) thermal gyroradius, ion thermal speed, and tokamak major radius. The most unstable ETG mode is found at electron-scale ky = 4.5 ρti−1, ωr = 24.3 vti/R0 and γ = 1.16 vti/R0. Although the wavenumbers and frequencies of TEM and of ETG are different, the wave phase velocities in the toroidal direction are similar, that is, (ωr/ktor)TEM = 42.7 vtiρti/R0 and (ωr/ktor)ETG = 45.1 vtiρti/R0, with the toroidal wavenumber ktor = εrky/q, where the εr = r/R0 is the inverse aspect ratio of the torus and q is the safety factor. Using an estimate of the toroidal precession drift velocity for deeply trapped electrons vpre ~ mev2q/(2erB0), where me, e, r, and B0 are the electron mass, electric charge, tokamak minor radius, and equilibrium magnetic field strength, the resonant condition of TEM (vpre = ωr/ktor) is satisfied when the particle velocity v = 1.9 vte. TEM has been considered relevant for experimental density scaling or electron temperature profile based on non-linear analytic theory29,30. Recent gyrokinetic simulation studies have also attracted researchers’ attention because of the impact on the tokamak edge transport31 and the long-standing mystery of the hydrogen isotope effect32. Nevertheless, the cross-scale interactions between TEM and ETG have not been fully investigated yet.

### Tracer particle trajectory analysis

The multi-scale turbulence simulations show that large-scale TEM and small-scale ETG fluctuations can co-exist in non-linearly developed turbulent flows. A typical trapped electron trajectory bounces on the weak magnetic field side of the torus outer region and makes a drift motion in the toroidal direction. The trapped electrons experience the fluctuating electric fields of TEM and ETG turbulence during the toroidal drift motion, as plotted in Fig. 2a. The poloidal electric fields of TEMs affect particles close to the resonant velocity (v = 2 vte, vpre = 47.3 vtiρti/R0) over a toroidal path length yq/(εrρti) < 400, which causes radial motion by the E × B drift (Fig. 2b). Further, an off-resonant particle (v = 2.5 vte, vpre = 73.9 vtiρti/R0) travels faster than waves, feels positive and negative electric fields alternately, and has no net radial displacement. Since the ETG modes also propagate with the phase velocity close to that of TEMs, small-scale ETG electric fields are also averaged out for the off-resonant particles (seen as short spikes of the blue line in Fig. 2a). However, the effects of the ETG modes on resonant particles are significant because the ETG modes also propagate along with the toroidal drift of the resonant particles. Further, the trajectory of a resonant particle is disturbed by small-scale turbulence (Fig. 2b). A secular displacement is observed (the red line in Fig. 2b after yq/(εrρti) > 700) because the tracer particle trajectory is modified by small-scale turbulence and moved in an oppositely rotating large-scale eddy. Since the statistical correlation between turbulent flows and perturbations of plasma distribution functions determines the resultant turbulent transport, the impacts of small electron-scale turbulence on turbulent transport are quantitatively investigated in the following analyses.

### Turbulent fluctuation profiles

Perturbed electron pressure and the streamlines of turbulent E × B flows are plotted in Fig. 3a. Radially elongated fluctuations of TEMs are observed in the torus outer region, so-called the bad curvature region. Streamlines of the E × B flows are superimposed on the colour map, namely, turbulent E × B flows cause electron thermal transport. According to the flow directions, high-temperature fluctuations go outward and low-temperature fluctuations inward. Velocity–space dependence of turbulent flux in Fig. 3c shows that trapped particles (surrounded by green lines) satisfying the precession drift resonance condition (on black dashed line) are responsible for the turbulent thermal transport. In the magnified picture of perturbed electron pressure and streamlines in Fig. 3b, small-scale ETG turbulent eddies are observed to co-exist with large-scale TEM fluctuations. This means that the small-scale ETG turbulence disturbs the streamline of E × B flows, modifies the correlation between turbulent flows and perturbed electron pressure, and possibly affects electron heat transport.

### Turbulent transport spectra

To examine the effect of ETG turbulence on TEM-driven turbulent transport, multi-scale simulation results are compared with an ion-scale simulation resolving only TEM scales and an electron-scale simulation resolving only ETG scales (for details, see “Methods”). The resultant poloidal wave number (ky) spectra of electron energy flux are shown in Fig. 4. The multi-scale spectrum shows two peaks attributed to low-ky TEM and high-ky ETG turbulence. Low-ky TEM components in the multi-scale simulation are reduced compared with those in the single ion-scale simulation, suggesting the suppression of TEM by ETG turbulence. The cross-scale interactions modify ion-scale turbulent fluctuation amplitude, which affects turbulent transport levels of not only electrons but also fuel D, T, and He ash. The turbulent heat fluxes in multi-scale TEM/ETG turbulence [Qe(TEM/ETG) = 5.66 QgB, QD + QT(TEM/ETG) = 0.24 QgB, QHe(TEM/ETG) = 0.02 QgB] are reduced compared with those in single-scale TEM turbulence [Qe(TEM) = 33.63 QgB, QD + QT(TEM) = 1.11 QgB, QHe(TEM) = 0.09 QgB] because of the suppression of TEM turbulence by ETG turbulence, where QgB = neTecaρa2/R02 is the gyro-Bohm unit with the speed of acoustic wave ca = √(Te/mi) and the acoustic gyroradius ρa. The agreement of high-ky ETG peaks of turbulent flux spectra in multi-scale and single electron-scale simulations seems coincident. Although ETG turbulence initially saturates at a higher transport level, ETG-driven zonal flows suppress turbulent transport after a long time tvti/R0 ≥ 50 in the single electron-scale simulation (not shown), which is consistent with a recent study on single-scale ETG turbulence10. Therefore, the suppression of ETG turbulence by ETG-driven zonal flows dominates the single electron-scale simulation result, whereas no significant zonal flow is observed in the multi-scale simulation, indicating the existence of suppression mechanisms of ETG turbulence by cross-scale interactions.

### Gyrokinetic non-linear entropy transfer analysis

The cross-scale interactions between the TEM and ETG modes can be interpreted in two ways. Moving from the large to small scales, the suppression of ETG turbulence in the appearance of TEMs is due to the distortion of the electron-scale streamers by the ion-scale turbulent eddies, as observed in previous multi-scale simulations2,33. In contrast to a previous work discussing the suppression of ETG modes by TEM-driven zonal flows (poloidally symmetric flows)34, in this study, there are no strong zonal flows (Fig. 3a). Our results indicate that the shearing of TEM turbulent eddies (not necessarily zonal flows) can suppress ETG turbulence. Moving from small to large scales, the reduction of TEM turbulent transport in the presence of ETG turbulence is in contrast to the multi-scale simulations of ion-temperature-gradient (ITG) modes2 but resembles the suppression of micro-tearing modes (MTM) by ETG turbulence5. The non-linear cross-scale interactions between electron-scale ETG turbulence and ion-scale TEM turbulence are investigated using the gyrokinetic non-linear entropy transfer analysis35. The perturbed entropy is a measure of amplitude fluctuations of the plasma distribution function, and its non-linear excitation or damping is described by the entropy transfer function. The net entropy transfer to a mode with wave number k is split into contributions of the electron-scale, electron-scale coupling JkΩe,Ωe and the ion-scale, electron-scale coupling 2JkΩi,Ωe using the subspace transfer analysis technique36 and defining the ion and electron scales Ωi, and Ωe in the perpendicular wavenumber space. Spectra of the time-averaged transfer function in Fig. 5a shows that the electron-scale, electron-scale coupling has a negative contribution on low-ky TEM fluctuations (Fig. 5a, JkΩe,Ωe < 0 at kyρti < 0.5), which directly confirms the damping effect of ETG turbulence on TEMs. From the energy conservation relation among triad subspaces called the detailed balance, JkΩiΩe,Ωe + 2 JkΩeΩi,Ωe = 0, the suppression of TEMs by ETG turbulence (JkΩe,Ωe < 0 at kyρti < 0.5) indicates entropy transfer from low-ky TEMs to high-ky modes (2JkΩeΩi,Ωe = −JkΩiΩe,Ωe > 0). As plotted in Fig. 5b, net entropy gain in high-ky range via ion-scale coupling is observed at finite kx (JkΩi,Ωe > 0 at kyρti ~ 4 and kxρti > 1) but not at ETG peaks (kyρti ~ 4 and kxρti ~ 0, characterised by a peak of energy specrum at high wavenumber, which is close to linearly unstable ETG modes). These high-k modes create higher k fluctuations (JkΩe,Ωe > 0 at higher kyρti > 7, not shown), which are eventually damped by collisional dissipation. Additionally, the ion-scale, electron-scale coupling has a negative contribution on ETG (JkΩi,Ωe < 0 at kyρti ~ 4 and kxρti ~ 0), confirming the suppression of ETG modes by ion-scale turbulence.

### Extrapolation of multi-scale turbulent interactions toward high Te/Ti regime

Finally, the dependence of turbulent energy flux Qe on the temperature ratio Te/Ti is examined in Fig. 6. Corresponding linear dispersion relations (as in Fig. 1) and poloidal wavenumber spectra of electron energy flux (as in Fig. 4) for each Te/Ti are respectively shown in Supplementary Figs. 1 and 2. Since ETGs are highly unstable at Te/Ti = 1, turbulent transport in the multi-scale simulation agrees with that in the single electron-scale simulation. As the electron temperature increases, ETGs are stabilised (green line), whereas TEMs are destabilised (orange line). At Te/Ti = 4, TEM dominates turbulent transport even in the multi-scale simulation. The Te/Ti = 3 case is thoroughly investigated in this study, where TEMs are close to marginal stability and significantly affected via the cross-scale interactions with ETG turbulence. From the ITER profile modelling and a reference value of a high Te discharge of the DIII-D tokamak37, a reactor-relevant temperature ratio is considered around 1 < Te/Ti < 2 due to the ion–electron energy exchange. Our survey of dependence of Qe on Te/Ti covers this range. An important consequence is that the ETG contribution survives in a wider parameter range 1 < Te/Ti < 3, although it may have been considered that ETG could have non-negligible contribution when Te ~ Ti and sufficiently large electron temperature8. Additionally, the multi-scale turbulence simulation shows the existence of an appropriate Te/Ti range where the cross-scale interactions suppress turbulent transport. The suppression of near-marginal TEM by ETG turbulence leads the upshift of the critical temperature ratio for an increase of TEM-dominated energy flux (from Te/Ti ~ 2 in the ion-scale simulation to Te/Ti ~ 3 in the multi-scale simulation), analogous to the Dimits upshift of critical ion temperature gradient where zonal flows suppress near marginal ITG modes38.

## Discussion

A series of our works on multi-scale turbulence in magnetised plasma indicates some common features: large-scale turbulence tends to suppress small-scale turbulence (ITG/ETG2,3,4, MTM/ETG13, and TEM/ETG in this study), whereas small-scale turbulence tends to destroy large-scale structures (damping of short-wave-length zonal flows by ETG36, destruction of radially localised current sheet of MTM by ETG5 and disturbance of drift resonance between trapped electrons and TEM by ETG in this study). These findings suggest the mutual conjunction between disparate-scale turbulence as a generic nature of cross-scale interactions beyond a conventional turbulence theory described using single-scale energy injection/cascade/dissipation processes.

Our results answer the question of whether the cross-scale interactions are needed to be taken into account for future burning plasma experiments. Even beyond the existing ion-heated devices Te ~ Ti, electron-scale turbulence can have impacts in electron heated plasma with high electron temperature Te > Ti. This study demonstrates the possibility of reducing total electron heat flux via cross-scale interactions. Considering the opposite dependence of TEM and ETG instabilities on the temperature ratio Te/Ti, our results reveal the existence of an appropriate Te/Ti range where the cross-scale interactions reduce turbulent transport, which will be advantageous for optimum tokamak operation. This finding is particularly important in burning plasma, because electron heating by the fusion-born alpha particles keeps electron temperature high Te > Ti. It also has impacts on understanding electron-heated plasma at the PFPO-1 phase in the ITER research plan, contributing the early success of fusion energy development.

This work has extensively investigated the cross-scale interactions between TEM and ETG turbulence by assuming electron temperature and its gradients exceed those of ions, though the dominant instabilities at ion scale (e.g, ITG, TEM, and MTM) depend on magnetic configuration and plasma parameters. This work is also limited to simulations with electrons, deuterium and tritium fuels, and helium ash, excluding energetic alpha particle dynamics. It has been reported that TEM drives low-level transport of alpha particles39. The resonant interactions between energetic particles and micro-instability will be significant for ITG modes40,41 but not for TEM and ETG modes because the propagation directions are opposite42. Therefore, interactions between energetic particles and TEM/ETG turbulence are expected to be weak. When we consider interplay from electron to ion-scale turbulence and macroscopic fluctuations, magnetohydrodynamic instability driven by energetic particles will become a candidate for the third player43, which is a theoretically and numerically challenging subject.

## Methods

### Simulation details

Micro-instabilities and turbulent transport in magnetised plasma are simulated using the gyrokinetic Vlasov simulation code GKV24,25. The code is parallelised by a hybrid of message-passing interface and open multi-processing. Optimisation techniques for high-performance computing are implemented, such as the pipelined computation-communication overlap, segmented process mapping on the three-dimensional torus interconnect25, and communication-avoiding iterative solver for the implicit collision operator44. This implementation ensures that the GKV code achieves a good scalability up to 12,288 nodes on the Fugaku supercomputer, 3.1 Peta-FLOPs (floating-point operation per second), which comprises 7.5% of the theoretical peak performance of the architecture and parallel efficiency of 83.7%. The highly optimised code and plentiful computational resources of Fugaku enable us to investigate the unexplored multi-scale nature of turbulent transport in burning fusion plasma.

Time evolution of the perturbed distribution functions fs of plasma species s, the electrostatic potential ϕ, and the magnetic vector potential parallel to the equilibrium magnetic field A|| is solved based on the delta-f gyrokinetic Vlasov–Poisson–Ampère equations26. The configuration space is represented by field-aligned coordinates x = r − r0, y = [q(r)θ − ζ]r0/q(r0), z = θ, where r, θ, and ζ are the tokamak minor radius, and the poloidal and toroidal angles, respectively. The velocity–space coordinates are the parallel velocity v|| and magnetic moment μ. The local flux-tube model45 resolves perturbed quantities in a long and thin simulation box along a field line, whereas the equilibrium quantities are approximated at the flux-tube centre r = r0, consistent with delta-f gyrokinetic ordering. Then, periodicities in perpendicular directions x and y are assumed along with homogeneous turbulence in fluids. The last boundary condition is the torus periodicity f(r, θ + 2π, ζ, v||, μ) = f(r, θ, ζ, v||, μ). In this study, the equilibrium magnetic field is assumed to have a concentric circular torus geometry (the so-called s-α model with geometric α = 0), which is characterised by the tokamak inverse aspect ratio εr, safety factor q, and magnetic shear ŝ. We selected εr = 0.18, q = 1.42 and ŝ = 0.8. The following plasma species were included in simulations: electron, deuterium, tritium, and helium (s = e, D, T, and He). The employed plasma parameters are e = eD = eT = −ee = eHe/2, mi = 1837 me = mD/2 = mT/3 = mHe/4, Ti = TD = TT = THe, nD = nT = 0.45 ne, nHe = 0.05 ne, R0/Lne = R0/LnD = R0/LnT = R0/LnHe = 3, R0/LTe = 9.342 and R0/LTD = R0/LTT = R0/LTHe = 1, where Lns = −den ns/dx and LTs = −den Ts/dx are the density and temperature gradient scale lengths. The elementary electric charge e, hydrogen mass mi, and tokamak major radius R0 are used as references. The charge density satisfies the quasi-neutrality condition ∑s esns = 0 and ∑s esns/Lns = 0. The plasma beta value is β = μ0neTD/B02 = 0.05%, normalised Debye length is λ2 = ε0B02/(mine) = 10−3 and normalised collision frequency is ν* = qR0τee−1/(√2εr3/2vte) = 0.05 with electron–electron collision time τee. The above plasma parameters are chosen from a previous study32 but the number of plasma species is increased. Most parameters are comparable to the existing tokamak device (e.g., a high Te discharge of DIII-D #17314737), whereas the electron temperature and its gradient are slightly enhanced to mimic the electron-heated burning fusion plasma. Although electron heating by the alpha particles is the main heat source in the burning plasma, the ion–electron energy exchange process also heats ion species. When the ITG increases due to the energy exchange, the ITG modes are destabilised. For the multi-scale ITG/ETG turbulence at Te = Ti and R0/LTe = R0/LTi, detailed mechanisms of cross-scale interactions between ITG and ETG modes have been reported previously2,36. In this study, we focus on the parameter regime at Te > Ti and R0/LTe > R0/LTi which has not yet been analysed in existing devices. We examined the electron temperature dependence in the range 1 ≤ Te/Ti ≤ 4, and detailed analyses are presented for the case of Te/Ti = 3, where ETG turbulence significantly affects near-marginal TEMs. These parameters are also related to the electron-heated plasma at the PFPO-1 phase in the ITER research plan which is an important step for early success of ITER. The prediction of the integrated modelling of PFPO-1 phase H-mode plasma reported high central temperature ratio Te/Ti > 3 and R0/LTe > R0/LTi15. For the multi-scale turbulence simulations, we employed simulation box sizes 0 ≤ x/ρti < 125, 0 ≤ y/ρti < 40π,–π ≤ z < π,−4.5 ≤ v||/vts ≤ 4.5, 0 ≤ μB0/Ts ≤ 12.5, and grid points in each dimension (Nx, Ny, Nz, Nv||, Nμ) = (2048, 2048, 40, 64, 16) for the Te/Ti = 1 case and (Nx, Ny, Nz, Nv||, Nμ) = (1024, 1024, 40, 64, 16) for the 2 ≤ Te/Ti cases. Since the GKV code treats perpendicular x and y space using the Fourier spectral method with 2/3 de-aliasing rule, f(x, y, z, v||, μ) = ∑kxky fk(z, v||, μ) exp(ikxx + ikyy), the corresponding perpendicular wavenumber resolutions are kx,min = ky,min = 0.05ρti−1, kx,max = ky,max = 33.9ρti−1 for the Te/Ti = 1 case and kx,max = ky,max = 16.95ρti−1 for the 2 ≤ Te/Ti cases. For single ion-scale turbulence simulations, we employed reduced perpendicular wavenumber space kx,max = 4ρti−1, ky,max = 1ρti−1, which well resolves large ion-scale micro-instabilities and associated turbulence but excludes small electron-scale dynamics. Further, for single electron-scale turbulence simulations, we employed smaller perpendicular box sizes kx,min = ky,min = 0.5ρti−1, which covers only electron-scale micro-instabilities but excludes ion-scale ones.

### Tracer particle analysis

In Fig. 2, tracer particle trajectories are calculated to explain behaviour of resonant and off-resonant particles and to examine the effects of small electron-scale turbulence on the trajectories. Because of the low β value, magnetic perturbations are neglected in diagnostics. The equation of motion of a gyrokinetic electron is solved up to the lowest order of ρte/R0,

$$\frac{{{{{{\rm{d}}}}}}{{{{{\bf{x}}}}}}}{{{{{{{\rm{d}}}}}}t}}={v}_{\parallel }{{{{{\bf{b}}}}}}+{{{{{{\bf{v}}}}}}}_{{{{{{\rm{ed}}}}}}}+{{{{{{\bf{v}}}}}}}_{{{\rm{E}}}},\,\frac{{{{{{\rm{d}}}}}}{v}_{\parallel }}{{{{{{{\rm{d}}}}}}t}}=-\frac{\mu {\nabla }_{\parallel }{B}_{0}}{{m}_{{{\rm{e}}}}},\,\frac{{{{{{\rm{d}}}}}}\mu }{{{{{{{\rm{d}}}}}}t}}=0,$$
(1)

where B = B0b, ved, and vE are the equilibrium magnetic field, electron magnetic drift, and E × B drift velocities, respectively. Spatio-temporal data of gyrophase-averaged electrostatic potential from multi-scale turbulence simulations are used for evaluating the E × B drift. Since the pitch angle at the poloidal angle θ = 0 is set as 0.45π, the parallel velocity and magnetic moment for a resonant (v = 2vte) particle are v|| = 0.31vte, μ = 2.38Te/B0 and v|| = 0.39vte, μ = 3.72Te/B0 for an off-resonant (v = 2.5vte) particle. Without E × B flows, the conservation of the canonical angular momentum ensures that there is no radial displacement of a particle. Even when E × B flows exist, there will still be no net radial transport if the electrostatic potential is time-independent because particles move only along the static electrostatic potential contour. Therefore, net radial displacement of a collisionless particle is induced by fluctuating E × B flows. For the analysis of turbulent transport, a statistical correlation between the fluctuating E × B flows and perturbations of the plasma distribution functions is necessary to be evaluated.

### Definition of the velocity–space-dependent turbulent energy flux

Instead of calculating trajectories of large numbers of particles, we have solved the time evolution of plasma distribution functions. Then, the correlation between a turbulent radial E × B flow and a perturbed distribution function is obtained by taking the average in homogeneous directions x and y in a simulation box Lx × Ly and over a range of time t0 < t < t0 + T. When the particle kinetic energy is multiplied, the velocity–space-dependent turbulent energy flux in Fig. 3c is expressed as

$${Q}_{{{{{{\rm{e}}}}}}}^{{{{{{\rm{v}}}}}}}\left(z,{v}_{\parallel },\mu \right)=\left(\frac{{m}_{{{{{{\rm{e}}}}}}}{v}_{\parallel }^{2}}{2}+\mu {B}_{0}\right)\int _{{t}_{0}}^{{t}_{0}+T}\frac{{{{{{{\rm{d}}}}}}t}}{T}\int_{0}^{{L}_{x}}\frac{{{{{{{\rm{d}}}}}}x}}{{L}_{x}}\int_{0}^{{L}_{y}}\frac{{{{{{{\rm{d}}}}}}y}}{{L}_{y}}{{{{{{\bf{v}}}}}}}_{{{{{{\rm{E}}}}}}}\cdot {{{{{\boldsymbol{\nabla }}}}}}x{f}_{{{{{{\rm{e}}}}}}},$$
(2)

where we retain the poloidal angle θ = z dependence to analyse the trapped-passing boundary, which is regarded as a microscopic heat flux per unit of velocity–space volume46. Taking velocity–space and poloidal integrals, one obtains the time-averaged turbulent energy flux Qe = 〈∫ dv3 Qevθ, where angle brackets 〈θ denote the flux-surface average.

### Definition of the turbulent energy flux spectrum

Because the turbulent transport is a convolution of a turbulent radial E × B flow and a perturbed distribution function, the time-averaged perpendicular wavenumber spectrum of the turbulent energy flux is given by

$${Q}_{{{\rm{e}}}{{{{{\bf{k}}}}}}}=\int_{{t}_{0}}^{{t}_{0}+T}\frac{{{{{{{\rm{d}}}}}}t}}{T}{{{{{\rm{Re}}}}}}\left[{\left\langle -\frac{{{{{{\bf{b}}}}}}.{{{{{\boldsymbol{\cdot }}}}}}{{{{{\boldsymbol{\nabla }}}}}}x\times {{{{{\boldsymbol{\nabla }}}}}}y}{B}{{{{{\rm{i}}}}}}{k}_{y}{\phi }_{{{{{{\bf{k}}}}}}}{p}_{{{{{{\rm{e}}}}}}{{{{{\bf{k}}}}}}}^{* }\right\rangle }_{\theta }\right].$$
(3)

The gyrophase-averaged perturbed electron pressure is denoted by pek = ∫ dv3 (mev||2/2+μB0) J0(kρe) fek with the zeroth-order Bessel function J0 and the perpendicular wavenumber k. The poloidal wavenumber spectra are calculated by taking the summation of Qek over kxρti, Qeky = kx Qek. In Fig. 4, the plot is normalised to compare the simulations with different minimum wavenumber Δky = ky,min on an equal footing, Qe = ∑ky Qeky = ∫dky (Qekyky).

### Definition of the non-linear triad transfer function

The fluctuation intensity of distribution functions is measured by the perturbed entropy variable47. The entropy balance equation describes the entropy production due to transport fluxes under thermodynamic gradient forces, which balances the collisional dissipation in a steady state48. In the perpendicular wavenumber space, the quadratic non-linearity of the E × B advection term characterises the triad interactions35,49. The gyrokinetic triad transfer function for the electron entropy balance is given by

$${J}_{{{{{{\bf{k}}}}}}}^{{{{{{\bf{p}}}}}},{{{{{\bf{q}}}}}}}\left(t\right)={\delta }_{{{{{{\bf{k}}}}}}+{{{{{\bf{p}}}}}}+{{{{{\bf{q}}}}}}={{{{{\bf{0}}}}}}}\frac{{{{{{\bf{b}}}}}}{{\cdot }}{{{{{\bf{p}}}}}}\times {{{{{\bf{q}}}}}}}{2{B}_{0}}{{{{{\rm{Re}}}}}}\left[{\left\langle {{\int }}{{{{{\rm{d}}}}}}{v}^{3}\left({\chi }_{{{{{{\bf{p}}}}}}}{g}_{{{{{{\rm{e}}}}}}{{{{{\bf{q}}}}}}}-{\chi }_{{{{{{\bf{q}}}}}}}{g}_{{{{{{\rm{e}}}}}}{{{{{\bf{p}}}}}}}\right)\frac{{T}_{{{{{{\rm{e}}}}}}}{g}_{{{{{{\rm{e}}}}}}{{{{{\bf{k}}}}}}}}{{F}_{{{{{{\rm{eM}}}}}}}}\right\rangle }_{\theta }\right],$$
(4)

where χk = 〈ϕk − v|| A||k〉 and gek = fek + eeϕkFeM/Te denote the gyrophase-averaged generalised potential and the non-adiabatic part of the perturbed electron distribution function for a mode k. FeM is the equilibrium Maxwell distribution. The triad transfer function Jkp,q describes the interaction of entropy variables among the three wavenumber modes {k, p, q} satisfying the non-linear coupling condition k + p + q = 0. Namely, positive or negative Jkp,q means entropy gain or loss of mode k via the coupling with p and q. The detailed balance relation Jkp,q + Jpq,k + Jqk,p = 0 ensures entropy conservation.

To extract the large ion-scale and small electron-scale contributions separately, the subspace transfer function is defined as36,50

$${J}_{{{{{{\bf{k}}}}}}}^{{\varOmega }_{{{{{{\rm{s}}}}}}},{\varOmega }_{{{{{{{\rm{s}}}}}}}^{{\prime} }}}\left(t\right)=\mathop{\sum} \limits_{{{{{{\bf{p}}}}}}\in {\varOmega }_{{{{{{\rm{s}}}}}}}}\mathop{\sum }\limits_{{{{{{\bf{q}}}}}}\in {\varOmega }_{{{{{{{\rm{s}}}}}}}^{{\prime} }}}{J}_{{{{{{\bf{k}}}}}}}^{{{{{{\bf{p}}}}}},{{{{{\bf{q}}}}}}},$$
(5)

where Ωi and Ωe are subspaces in wavenumber space corresponding to ion and electron scales. The subspace transfer function represents the energy gain or loss of the analysed mode via the coupling with subspaces. In Fig. 5, we split the wavenumber space into the ion-scale Ωi = {k |−4 < kxρti < 4, −1 < kyρti < 1} and electron-scale Ωi = {k | the others}. Although there is the arbitrariness of the boundary choice between ion and electron scales, doubling the |kyρti | boundary from 1 to 2 gives no qualitative difference to the analysis because the peaks of the ion and electron scales are well separated as shown in Fig. 1. The subspace transfer also satisfies the symmetric property JkΩpq = JkΩqp, and the detailed balance among three subspaces JkΩkΩpq + JkΩpΩqk + JkΩqΩkp = 0.


text:
# Proof of an algebraic theorem

Recently I have known an algebraic theorem on polynomial while learning the method of partial fraction.
The theorem is :
Any polynomial can be written as the product of linear factors and irreducible quadratic factors.
I did not find an intuitive proof of this theorem.I asked a question in this link http://math.stackexchange.com/questions/1158560/need-of-an-intuitive-proof-of-an-algebraic theorem

and an answer was given there but I did not fully understand this.Can anyone prove the theorem intuitively?


text:
de.mpg.escidoc.pubman.appbase.FacesBean
Deutsch

Hilfe Wegweiser Impressum Kontakt Einloggen

# Datensatz

DATENSATZ AKTIONENEXPORT

Freigegeben

Bericht

#### A general technique for automatically optimizing programs through the use of proof plans

##### MPG-Autoren
http://pubman.mpdl.mpg.de/cone/persons/resource/persons44961

Programming Logics, MPI for Informatics, Max Planck Society;

##### Externe Ressourcen
Es sind keine Externen Ressourcen verfügbar
##### Volltexte (frei zugänglich)

MPI-I-94-239.pdf
(beliebiger Volltext), 28MB

##### Ergänzendes Material (frei zugänglich)
Es sind keine frei zugänglichen Ergänzenden Materialien verfügbar
##### Zitation

Green, I.(1994). A general technique for automatically optimizing programs through the use of proof plans (MPI-I-94-239). Saarbrücken: Max-Planck-Institut für Informatik.

The use of {\em proof plans} -- formal patterns of reasoning for theorem proving -- to control the (automatic) synthesis of efficient programs from standard definitional equations is described. A general framework for synthesizing efficient programs, using tools such as higher-order unification, has been developed and holds promise for encapsulating an otherwise diverse, and often ad hoc, range of transformation techniques. A prototype system has been implemented. We illustrate the methodology by a novel means of affecting {\em constraint-based} program optimization through the use of proof plans for mathematical induction. Proof plans are used to control the (automatic) synthesis of functional programs, specified in a standard equational form, {$\cal E$}, by using the proofs as programs principle. The goal is that the program extracted from a constructive proof of the specification is an optimization of that defined solely by {$\cal E$}. Thus the theorem proving process is a form of program optimization allowing for the construction of an efficient, {\em target}, program from the definition of an inefficient, {\em source}, program. The general technique for controlling the syntheses of efficient programs involves using {$\cal E$} to specify the target program and then introducing a new sub-goal into the proof of that specification. Different optimizations are achieved by placing different characterizing restrictions on the form of this new sub-goal and hence on the subsequent proof. Meta-variables and higher-order unification are used in a technique called {\em middle-out reasoning} to circumvent eureka steps concerning, amongst other things, the identification of recursive data-types, and unknown constraint functions. Such problems typically require user intervention.