text:
## Introduction

Magma ascent dynamics during explosive eruptions is mainly controlled by the relation between magma supply and discharge rate1,2, which are strongly related to magma chamber conditions and volcanic conduit geometry3. Despite several numerical models have been employed for studying the physical conditions of ascending magmas4,5,6, they commonly assume mechanically stable geometries with constant radius in depth. Macedonio et al.7 identified four erosive mechanisms able to produce syn-eruptive changes in conduit geometry, indicating the zones where each one is probably dominant. Nonetheless, conditions for syn-eruptive mechanical stability of volcanic conduits have never been addressed in detail, nor has been studied the effect of magma rheology on them. Aravena et al.8 proposed that conduit dimensions control its mechanical stability, and a minimum radius (and hence a minimum mass flow rate) for reaching stable conditions can be computed. Under these assumptions, axisymmetric conduits with fixed radius represent a mechanically stable configuration only for a narrow range of conditions, and widening processes probably lead to geometries characterized by depth-dependent dimensions. Thus, since magma rheology controls the pressure profile along the conduit, which in turn controls the mechanical stability, important hints onto the relationships between magma composition, conduit stability and eruptive style are here derived by extending this analysis to different magma types commonly involved in large explosive events. In order to investigate this, we compare stability conditions for typical phonolitic, trachytic, dacitic and rhyolitic explosive eruptions. The most important eruptive variables and the pressure profile along the conduit (P(z)) were derived by using a 1D steady-state model8,9 (http://demichie.github.io/MAMMA) and, with the objective of determining the minimum pressure needed to avoid conduit collapse (Pcollapse(z)), we applied the Mogi – Coulomb collapse criterion10, as illustrated in Fig. 1. Additionally, we studied the expected temporal evolution of eruptions under the effects of conduit enlargement, considering trachytic and rhyolitic magmas. We also tested the consequences on the eruptive dynamics of three axisymmetric geometries with depth-dependent radii, using four different magma compositions. Finally, data from selected case studies were analyzed, for a semi-quantitative validation of modeling results.

## Results and Discussion

### Mechanical stability of volcanic conduits

In explosive eruptions, conduit collapse conditions, quantified using an ‘instability index’ defined as max(Pcollapse(z) − P(z)), are preferably reached near and above the fragmentation level, a zone characterized by an abrupt pressure drop in the ascending magma (Fig. 1)7,8. Consequently, instability conditions are favored by deep magma fragmentation, and a monotonic tendency is observed between instability index and conduit radius8. Figure 2a–d shows the isolines of the minimum radius needed for developing stable conduits (hereafter, critical radius) as a function of water content and inlet pressure, for different magma compositions.

Results indicate that magma rheology is a major controlling factor of the instability character of volcanic conduits. Indeed, in order to achieve stability conditions, dacitic/rhyolitic magmas need conduits several times wider than their phonolitic/trachytic counterparts; and significant differences are also observed between dacitic and rhyolitic melts. It is also interesting to note that, for dacitic and rhyolitic magmas, the stable conduits span over about just one order of magnitude, while they vary over about two orders of magnitude for phonolitic and trachytic magmas. In particular, for the range of input parameters here adopted and considering a 5000-m long conduit, critical radii range between 7 and 14 m for phonolitic magmas, whereas predicted critical radii for trachytic magmas vary between 6 and 13 m. Conversely, critical radii larger than 20 m and 50 m were estimated for dacitic and rhyolitic magmas, respectively. Hence, if we assume that volcanic conduits are continuously widened up to reach stability conditions, numerical simulations suggest that the ascending magma rheology controls the expected conduit dimensions and thus the resulting eruption rate. These results are consistent with the high mass discharge rates commonly observed in sustained dacitic/rhyolitic eruptions, whereas phonolitic/trachytic magmas are capable of producing sustained eruptions with narrower conduits and lower mass fluxes, as confirmed by a compilation of global data and the associated variance analysis (Supplementary Fig. S1 and Supplementary Tables S1 and S2). Indeed, statistically significant differences have been identified between the average values of eruptive column height of phonolitic/trachytic and dacitic/rhyolitic explosive events (23.6 and 30.1 km, respectively), which would be related with important differences in the corresponding mass discharge rates (~1.5·108 and ~4.7·108 kg/s for the average eruptive column height of phonolitic/trachytic and dacitic/rhyolitic magmas, respectively)11. Hence, in addition to magma source conditions (e.g. water content, inlet pressure) and the viscosity-dependent efficiency of outgassing mechanisms (i.e. permeable degassing and bubbly flow), we suggest that typical eruption rates for different magma compositions are also controlled by conduit stability and its interplay with the changing properties of ascending magmas.

Moreover, in order to produce a stable conduit, a minimum mass discharge rate can be derived for all the studied compositions (1·106–3·106 kg/s for phonolitic and trachytic magmas, 6·106–2·107 kg/s for dacitic magmas and 3·107–8·107 kg/s for rhyolitic magmas, Fig. 3). Although these results are sensitive to mechanical properties of the country rocks12, they suggest that the unsteady character commonly observed in low-mass flux eruptions could be produced by an unstable, narrow conduit characterized by episodic collapse events. Additionally, because differences of 1–2 orders of magnitude are observed between the estimates for the different studied compositions (from 1·106 to 8·107 kg/s), results suggest that the characteristic magma discharge rates needed for developing stationary explosive eruptions are highly controlled by magma rheology. Indeed, while quasi-steady, Plinian to sub-Plinian eruptions of phonolitic/trachytic magmas are often associated to intermediate values of mass discharge rate, steady dacitic/rhyolitic eruptions are generally characterized by very high magma discharge rates13,14, possibly stabilized by the development of wide conduits. Moreover, if collapsing conduits inhibit magma ascent, a minimum mass discharge rate for developing explosive eruptions is expected, significantly higher for dacitic/rhyolitic magmas than for their phonolitic/trachytic counterparts.

Syn-eruptive modifications of conduit geometry represent a crucial challenge in the analysis of volcanic eruptions, and the relative importance between the different erosion mechanisms raises additional questions for numerical modelling7. By assuming that conduit re-equilibrium to the changing magma properties may preserve nearly-axisymmetric geometries with fixed radius in depth, we can assume that volcanic conduits adopt a set of geometries whose dimensions are defined by the critical radius, which varies as a function of inlet overpressure and water content (Fig. 2). This condition is reasonable when fluid shear stress and overpressure-dominated fracture processes are enough efficient below magma fragmentation and the characteristic time for conduit collapse is sensibly lower than the timespan required for the occurrence of significant modifications in the ascending magma properties. Results indicate that temporal evolution of eruption rate is highly controlled by the balance between modifications in stability conditions of volcanic conduits (and hence conduit dimensions) and variations of source properties (e.g. water content, inlet pressure) (Fig. 4). In this sense, since relative modifications of conduit dimensions are higher for trachytic magmas in comparison to rhyolitic melts (differences of ~120% and ~50% between maximum and minimum critical radii, for the ranges considered for trachytic and rhyolitic magmas, respectively), eruption rates of trachytic magmas seem to be more sensitive to the effect of conduit stability, while rhyolitic magmas present a stronger dependence on magma source properties and their effects on the eruptive dynamics (Fig. 4b and f). Different variation trends of water content as a function of inlet pressure are also manifested in the lithic content through pyroclastic deposits, giving rise to diverse variation tendencies of the percentage of lithic fragments in the resulting pyroclastic deposits (Fig. 4c and g).

### Axisymmetric geometries with depth-dependent radius

Since stability conditions are not uniform along the conduit and the other erosive mechanisms act preferentially around and above magma fragmentation level7,8, preservation of cylindrical geometries with fixed radius along the conduit seems to be unlikely in natural conditions. For this reason, we tested three plausible axisymmetric conduit geometries with depth-dependent radii (Fig. 5a–c), in which the onset of conduit radius variations is concentrated around the fragmentation level of the fixed-radius equivalent case, as suggested by conduit mechanical stability.

In relative terms, variations in eruptive dynamics related to these conduit geometries exhibit similar trends for all the studied magma compositions (Fig. 5d–i and Supplementary Figs S2, S3 and S4 for comparisons). Results suggest that the evolution of the most important eruptive parameters is conditioned by the modality of conduit erosive processes. If the conduit is capable of inhibiting the collapse above the fragmentation level (i.e. producing NC1-like geometries, Fig. 5d and e), a significant increase in the mass discharge rate is expected (up to ~15%), which could be amplified by a downward migration of the fragmentation level (up to ~200 m) and, consequently, by the occurrence of instability conditions and widening processes in deeper zones of the conduit. Additionally, exit pressure tends to be higher than that observed in the fixed-radius equivalent case (in general, not higher than 30%), whereas the exit velocity changes, controlled by choked conditions at the vent, are more limited (in general, ±10%). On the contrary, if significant conduit enlargement occurs above the fragmentation level (i.e. producing NC2-like or NC3-like geometries, Fig. 5f–i), smaller modifications in magma discharge rate (in general, ±10%), fragmentation level (in general, ±100 m) and exit velocity (±10%) will occur, while a significant decrease in the exit pressure is expected (60–80% of the fixed-radius equivalent case or so).

Because of the strong contrast between the wall-rock volumes to erode for producing the different axisymmetric geometries with depth-dependent radii, important differences are expected on the composition and relative amount of lithic fragments in pyroclastic deposits. Indeed, the ratio between the mass of eroded lithic fragments and the eruption rate reveals that the expected lithic fraction with geometries NC2 and NC3 is one order of magnitude higher than that expected with geometry NC1, even though geometry NC1 produces more important effects on the eruptive dynamics. Thus, no direct relations between the observed fraction of lithic fragments in pyroclastic deposits and the magnitude of the eruptive dynamics variations are expected; and the effectiveness of wall rocks erosion processes in controlling the eruptive behavior is much higher for NC1-like geometries. Since axisymmetric geometries with depth-dependent radii do not necessarily tend to stability conditions8, it is not possible to suggest a continuous accommodation to stable geometric configurations. Instead, volcanic conduits would be characterized by permanent instability conditions and conduit geometry would be controlled by the characteristic times for changes in magma source properties (e.g. water content, inlet pressure) and gravitational collapse (eventually, as a function of instability degree), in addition to the effect of other erosion mechanisms. This is indirectly confirmed by the ubiquitous presence of lithic fragments throughout all the deposits of large pyroclastic eruptions.

### Analysis of selected case studies

Data from selected eruptions can be used for a semi-quantitative validation of the modeling results. The trachytic 1630 eruption of Furnas volcano (Sao Miguel, Azores) represents an appropriate case study for illustrating the relation between mass discharge rate and the unsteady character of volcanic eruptions. It was a mainly pulsating event characterized by relatively low mass discharge rates (0.2·106–6·106 kg/s)15 and fluctuations between magmatic and phreatomagmatic phases. Our results suggest that the low mass discharge rates produced unstable conditions in the conduit, generating episodic collapse events manifested in the pulsating nature of the eruption, possibly favoring the access of external water into the conduit. Indeed, since pore pressure favors conduit instabilities, collapse conditions were possibly concentrated around aquifer rocks12, producing magma-water interaction and the observed phreatomagmatic behavior during these pulsations. The range of mass discharge rate for this eruption is similar to that estimated for other sub-Plinian eruptions with magmas of similar rheology and characterized by an important unsteadiness16,17, suggesting a possible cause-effect relation with conduit stability conditions. In particular, the main part of the pyroclastic deposits related to the 512 AD phonolitic to tephri-phonolitic eruption of Vesuvius is characterized by a striking grain size alternation of fine to coarse lapilli, interpreted as the product of a highly oscillatory sub-Plinian phase16, followed by a pulsating phreatomagmatic phase. A similar unsteady behavior was interpreted for the initial sub-Plinian phase of the 472 AD eruption of Somma-Vesuvius (phonolitic to tephri-phonolitic magmas)17, with the alternating deposition of pyroclastic fall beds and pyroclastic density currents, also in this case followed by phases characterized by phreatomagmatic fragmentation.

The detailed, systematic study of the rhyolitic eruptions of the Mangaone subgroup (New Zealand)13,14 provides a sort of homogeneous database highly suitable for testing our results. In general, much higher eruption rates, respect to those discussed for the phonolitic/trachytic case, characterize this set of quasi-sustained Plinian eruptions, with peak mass discharge rates between 6.2·107 kg/s and 3.9·108 kg/s (Supplementary Table S3 and Supplementary Fig. S5) and the ubiquitous presence of lithic fragments and lithic-rich horizons in most of the studied units. Authors distinguished two situations13,14: (1) lithic-rich layers confined to pumice beds characterized by changes in the pumice size and/or evidences of interaction with external water, and interpreted as partial blockages of the conduit; and (2) lithic-rich layers in beds with uniform pumice size, indicating limited wall collapses, insufficient for interfering with the quasi-steady character of the Plinian eruption. The extent of conduit blockage related to wall collapse events is controlled by the collapsing volume and conduit dimensions. We suggest that, since narrow conduits produce favorable conditions to wall collapse (and consequent conduit blockage), the initial erosion rate (i.e. during inception and waxing phases) plays a crucial role in the viability of sustained Plinian eruptions. Indeed, seven units (B, C, D, E, F, G and K) out of twelve of Mangaone Subgroup are characterized by basal, lithic-rich deposits and peak mass discharge rates variable from 8.6·107 up to 3.9·108 kg/s. This clearly suggests that, in order to maintain a sustained flux of rhyolitic magma, an early conduit enlargement process is needed, and a consequence of this enlargement is the establishment of the high magma discharge rates typical of sustained Plinian eruptions18. On the other hand, the only two eruptions characterized by clear phases of collapsing column and ignimbrite deposition (units I and L), present a generally high lithic content throughout the entire sequence, suggesting that the continuous increase in conduit diameter was possibly one of the reasons for determining collapse conditions of the eruptive column. In addition, most of the units present lithic-rich beds during the waning phases and occasionally exhibit evidences of magma-water interaction13,18, interpreted as the result of incipient wall collapses produced by inlet pressure drops, before the total blockage of the conduit (i.e. shutdown of the eruption). Taupo pumice represents an additional case study for addressing sustained silicic eruptions19. In this case, the reported eruption rate is higher than 109 kg/s and, in agreement with our results, it produced a sustained explosive event. Well-constrained values of total lithic content (1.8·1012 kg)19 provide some lights for estimating feeding conduit dimensions. Considering an 8000-m long axisymmetric conduit with fixed dimensions in depth, radii larger than 170 m are expected, producing a highly stable conduit according to our results. Numerical simulations suggest that such particularly large conduit diameter could be related to an efficient conduit-opening process, probably favored by magma-water interaction12, with significant consequences on the resulting mass discharge rate. Additional suitable information is provided by the dacitic-rhyodacitic 1932 Quizapu eruption (Chilean Andes), which produced an “exceptionally uniform fall deposit”20. Still, as observed in most of the rhyolitic Mangaone eruptions, also in this case the lower part of the deposit is richer in lithic fragments than the upper part, and a general (although weak) upward coarsening of the fall deposit is described. Despite the percentage of lithic fragments is low, because of the high erupted volume, it resulted in a large volume of lithic fragments20, implying conduit radii larger than 100 m. These conduit dimensions and the reported mass discharge rate (9·107–2.5·108 kg/s)20 are in agreement with the development of a very stable feeding conduit and a highly steady explosive eruption, manifested in the described uniformity of pyroclastic deposits20.

On the other hand, Inyo Craters and Mono Craters (eastern central California) provide a subset of silicic explosive eruptions characterized by relatively low eruption rates21,22,23. During the latest explosive event in the Inyo volcanic chain, ~0.13 km3 of rhyolitic tephra was erupted in four successive eruptions. The first two eruptions produced pulsating, sub-Plinian columns separated by a period of column collapse22, exhibiting mass discharge rates lower than 107 kg/s, which is in agreement with the highly unstable character expected for these MDRs in rhyolitic/rhyodacitic feeding conduits. The latter two eruptions were characterized by higher MDRs (up to ~4·107 and ~3·107 kg/s, respectively), and the development of more sustained weak plumes, still with punctual periods of phreatomagmatic activity22. The transition between the second (South Deadman 2) and third eruption (Obsidian flow) was marked by a phreatomagmatic vent-clearing blast22, which would have suddenly increased conduit dimensions, favoring stability conditions and the development of more steady explosive events, in comparison with the two first eruptions. For Inyo Craters, geological evidences strongly support that magma ascent is particularly favored by structural settings23,24,25, thus it seems difficult to use lithic content to estimate conduit dimensions. Still, even in the latter two eruptions, total volumes of lithic fragments (Supplementary Table S4)22 are sensibly lower than that observed in sustained rhyolitic eruptions and thus much narrower, unstable conduits are expected. An additional case study of pulsating rhyolitic eruptions is the latest explosive eruption in Mono Craters23, characterized by low mass discharge rates and low volumes of lithic fragments, suggesting that they were unable to develop wide, stable feeding conduits.

## Concluding remarks

Modeling of magma ascent through axisymmetric volcanic conduits with fixed and depth-dependent radii suggests that magma composition and rheology play a leading role in defining the conditions of conduit stability, and consequently in controlling conduit dimensions, evolution of mass discharge rate and the amount of lithic fragments found in pyroclastic deposits. In particular:

1. (a)

Dacitic/rhyolitic magmas need conduits several times wider than phonolitic/trachytic magmas for developing mechanically stable conduits, which could explain the high mass discharge rates commonly observed in sustained dacitic/rhyolitic eruptions, whereas phonolitic/trachytic magmas would be capable of producing sustained explosive eruptions with relatively low mass discharge rates.

2. (b)

Conduit stability can influence the steadiness of volcanic eruptions, controlling the occurrence of pulsating variations in the eruptive parameters. Narrow, unstable conduits would be commonly related with oscillating volcanic eruptions, whereas wide, stable feeding conduits could produce steady explosive events and homogeneous pyroclastic deposits.

3. (c)

Conduit wall collapses seem to be particularly dominant during inception/waxing phases of explosive events, determining whether a well-developed steady-state phase is reached and thus controlling the early dynamics of volcanic events and the viability of sustained eruptions. Conduit collapse is also likely to occur during the waning phases of explosive eruptions, because of the expected inlet pressure drop, generating conduit blockages and controlling the eruption shutdown.

4. (d)

The nature of the erosive process along the conduit during volcanic eruptions is a first order factor for controlling the resulting eruptive dynamics, modifying parameters such as mass discharge rate, exit pressure and fragmentation depth. In particular, the eruptive dynamics would be conditioned by the ability of the conduit to inhibit widening processes above the fragmentation level.

## Methods

In order to study the pressure field along volcanic conduits (P(z)), we employed a 1D multiphase steady-state model which considers the main processes experienced by magmas during their ascent, such as crystallization, rheological changes, magma fragmentation, interaction with conduit walls, outgassing and degassing. We used appropriate sets of constitutive equations for describing the physical parameters of the system (Supplementary Table S5), chosen for studying representative cases of phonolitic, trachytic, dacitic and rhyolitic explosive volcanism. Initially, we considered a 5000-m long axisymmetric conduit with fixed dimensions in depth, and varied three input parameters: inlet pressure, water content and conduit radius (Supplementary Tables S5 and S6).

For evaluating the mechanical stability of the conduit, we calculated the minimum pressure needed to avoid conduit collapse (Pcollapse(z)), as described in Aravena et al.8. For that, we applied the Mogi-Coulomb criterion presented by Al-Ajmi and Zimmerman10 (Supplementary Table S7), by using the mechanical parameters shown in Supplementary Table S8. With the objective of quantifying the instability character of the conduit, we compared Pcollapse(z) and P(z), using the following expression, called instability index8:

$${\rm{\max }}({{\rm{P}}}_{{\rm{collapse}}}({\rm{z}})-{\rm{P}}({\rm{z}}))$$
(1)

Since a monotonic relationship is observed between conduit radius and instability index8, for given conditions of water content and inlet pressure, we interpolated the radius at which the instability index is equal to zero (critical radius), using a second order fit. Accordingly, the critical radius represents the minimum radius needed to avoid conduit collapse, for a given set of magma source conditions.

Critical radius calculations were also employed for studying the temporal evolution of volcanic conduits by assuming axisymmetric geometries with fixed radius in depth, whose dimensions are continuously re-equilibrated to the changing stability conditions produced by modifications of inlet pressure and water content, for trachytic and rhyolitic magmas. Inlet pressure was assumed to vary linearly between two fixed limits (135 MPa and 115 MPa), as a function of the mass of erupted magma; considering a total erupted mass of 1011 kg and 2·1012 kg for trachytic and rhyolitic magmas, respectively. This assumption is supported in the absence of exsolved water in magma reservoir for the solubility models here adopted (conduit length of 5000 m), and thus nearly incompressible melts are expected to fill the magma reservoir. For a given magma composition, two different hypothetical events were modelled, which are characterized by two different prescribed mathematical relations between inlet pressure and water content, and reflect discrepancies in compositional zonations of magma chamber (Fig. 4a and e). Still, initial and final input parameters are coincident for both modelled trends of a given magma composition, while the total eruption time is controlled by the resulting eruption rate and total erupted mass. In order to calculate the expected content of lithic fragments in pyroclastic deposits, we analyzed the modifications of conduit dimensions as critical radius changes.

For testing the effects of different geometries, we compared four cases: (1) axisymmetric conduits with fixed radius in depth (geometry C), (2) axisymmetric fixed-radius conduits with a local enlargement along a vertical distance zr (geometry NC1), (3) conduits with two coaxial cylindrical portions connected by a linearly variable transitional zone of length zr (geometry NC2) and (4) conduits with an axisymmetric lower portion with fixed radius in depth, connected with the surface by a linearly enlarging zone (geometry NC3). In simulations of axisymmetric conduits with depth-dependent radius (i.e. geometries NC1, NC2 and NC3), we set the variable-radius zone (zc) around the fragmentation level computed in the fixed-radius equivalent case (i.e. Rfixed(C) = Rmin(NC), with the same values of inlet pressure and water content); varying Rmax/Rmin and zr between specific limits (Supplementary Table S6).

On the other hand, in order to compare the typical intensity of explosive volcanic eruptions related to different magma compositions, we used information derived from a global database (LaMEVE)26. As an intensity measure, we employed the eruptive column height11, splitting data into four subsets: (1) basaltic and andesitic basaltic magmas, (2) andesitic magmas, (3) dacitic and rhyolitic magmas and (4) phonolitic and trachytic magmas. When two or more results are reported for different phases of a unique eruption, we selected the highest value; and we discarded all data with other compositions or information difficult to split (e.g. dacitic andesite, trachyandesite). Descriptive statistics and variance analysis were employed for results interpretation.


text:
# Small Problems with Two Variables¶

## General Process¶

The following steps can be used to create a two-variable BQM.

1. Make a constraint satisfaction table.
2. Create a system of equations.
3. Solve the system of equations.

The constraint satisfaction table is similar to a truth table - it covers all possible values for our two variables and considers whether or not the constraint that we are modeling is true or false for each choice of values.

## Example¶

We start with a simple problem. We have two variables, say $v_1$ and $v_2$, and we want a BQM that represents the constraint $v_1=v_2$. For QUBO and Ising we follow the same process.

### Step 1: Constraint Satisfaction Table¶

Set up a table for the two variables that covers all possible values they might take. Add a column in the table to indicate whether or not the constraint is satisfied (true) for each combination of variable values.

 QUBO Ising Equal? $x_1$ $x_2$ $s_1$ $s_2$ 0 0 -1 -1 Yes 0 1 -1 +1 No 1 0 +1 -1 No 1 1 +1 +1 Yes

Next, replace the final column of yes/no values with small/large values, respectively.

 QUBO Ising Value $x_1$ $x_2$ $s_1$ $s_2$ 0 0 -1 -1 0 0 1 -1 +1 1 1 0 +1 -1 1 1 1 +1 +1 0

In this step, we choose a small value when the constraint is satisfied because the QPU is designed to minimize a BQM. By choosing a small value, we line up the ground state (lowest energy the QPU can find) with the constraint being satisfied. Note that any choice of small and large value can be used.

### Step 2: Make a System of Equations¶

Recall from the last section the general form for QUBO and Ising.

QUBO:

$a_1x_1+a_2x_2+b_{1,2}x_1x_2+c$

Ising:

$h_1s_1+h_2s_2+J_{1,2}s_1s_2+c$

Using each row in the constraint satisfaction table, we can write an equation. Each pair of variable values, the general BQM model, and the final column value together determine an equation in which the BQM coefficients are the only unknowns. This results in four different equations (one for each row in the table).

QUBO Ising
$a_1\cdot 0+a_2 \cdot 0 +b_{1,2} \cdot 0 \cdot 0 +c=0$ $h_1\cdot (-1)+h_2\cdot (-1)+J_{1,2}\cdot (-1)\cdot (-1)+c=0$
$a_1\cdot 0+a_2 \cdot 1 +b_{1,2} \cdot 0 \cdot 1 +c=1$ $h_1\cdot (-1)+h_2\cdot (+1)+J_{1,2}\cdot (-1)\cdot (+1)+c=1$
$a_1\cdot 1+a_2 \cdot 0 +b_{1,2} \cdot 1 \cdot 0 +c=1$ $h_1\cdot (+1)+h_2\cdot (-1)+J_{1,2}\cdot (+1)\cdot (-1)+c=1$
$a_1\cdot 1+a_2 \cdot 1 +b_{1,2} \cdot 1 \cdot 1 +c=0$ $h_1\cdot (+1)+h_2\cdot (+1)+J_{1,2}\cdot (+1)\cdot (+1)+c=0$

### Step 3: Solve the System of Equations¶

Solve the system of equations for your coefficients.

QUBO Ising
$a_1=1$ $h_1=0$
$a_2 =1$ $h_2 =0$
$b_{1,2}=-2$ $J_{1,2}=-0.5$
$c=0$ $c=0.5$

To help with solving these systems of equations there are many resources online that are available. Some of these are WolframAlpha (wolframalpha.com) or Matrix Calculator (matrixcalc.org).

Our final models are:

QUBO:

$x_1+x_2-2x_1x_2$

Ising:

$-0.5s_1s_2+0.5$

## Exercise¶

What do the QUBO and Ising models look like for the constraint $v_1\geq v_2$?

format: plain


text:
# Definitions and some radiation theory¶

In radiation physics there is unfortunately several slightly different ways of presenting the theory. For instance, there is no single custom on the mathematical symbolism, and various different non SI-units are used in different situations. Here we present just a few terms and definitions with relevance to PySpectral, and how to possible go from one common representation to another.

## Symbols and definitions used in PySpectral¶

 Wavelength () Wavenumber () Central wavelength for a given band/channel () Central wavelength for a given band/channel () Relative spectral response for band as a function of wavelength Spectral irradiance at wavelength () Spectral irradiance at wavenumber () Blackbody radiation at wavelength () Blackbody radiation at wavenumber () Spectral radiance at wavenumber () Spectral radiance at wavelength () Radiance - (band) integrated spectral radiance ()

## Constants¶

 Boltzmann constant () Planck constant () Speed of light in vacuum ()

## Central wavelength and central wavenumber¶

The central wavelength for a given spectral band () of a satellite sensor is defined as:

Likewise the central wavenumber is:

And since , we can express the central wavenumber using the spectral response function expressed in wavelength space, as:

And from this we see that in general .

Taking SEVIRI as an example, and looking at the visible channel on Meteosat-8, we see that this is indeed true:

>>> from pyspectral.rsr_reader import RelativeSpectralResponse
>>> from pyspectral.utils import convert2wavenumber, get_central_wave
>>> seviri = RelativeSpectralResponse('Meteosat-8', 'seviri')
>>> cwl = get_central_wave(seviri.rsr['VIS0.6']['det-1']['wavelength'], seviri.rsr['VIS0.6']['det-1']['response'])
>>> print(round(cwl, 6))
0.640216
>>> rsr, info = convert2wavenumber(seviri.rsr)
>>> print("si_scale={scale}, unit={unit}".format(scale=info['si_scale'], unit=info['unit']))
si_scale=100.0, unit=cm-1
>>> wvc = get_central_wave(rsr['VIS0.6']['det-1']['wavenumber'], rsr['VIS0.6']['det-1']['response'])
>>> round(wvc, 3)
15682.622
>>> print(round(1./wvc*1e4, 6))
0.637648

In the PySpectral unified HDF5 formatted spectral response data we also store the central wavelength, so you actually don’t have to calculate them yourself:

>>> from pyspectral.rsr_reader import RelativeSpectralResponse
>>> print("Central wavelength = {cwl}".format(cwl=round(seviri.rsr['VIS0.6']['det-1']['central_wavelength'], 6)))
Central wavelength = 0.640216

## Wavelength range¶

Satellite radiometers do not measure outgoing radiance at only the central wavelength, but over a range of wavelengths defined by the spectral response function of the instrument. A given instrument channel is therefore often defined by a wavelength range in the form . Where and are defined by the first and last points in the spectral response function where the response is greater than a given threshold. Pyspectral has a utility function to enable users to compute these wavelength ranges:

>>> from pyspectral.rsr_reader import RelativeSpectralResponse
>>> from pyspectral.utils import get_wave_range
>>> seviri = RelativeSpectralResponse('Meteosat-8', 'seviri')
>>> wvl_range = get_wave_range(seviri.rsr['HRV']['det-1'], 0.15)
>>> print(round(num, 3) for num in wvl_range)
[0.456, 0.715, 0.996]

We denote the spectral irradiance which is a function of wavelength or wavenumber, depending on what representation is used. In PySpectral the aim is to support both representations. The units are of course dependent of which representation is used.

In wavelength space we write and it is given in units of .

In wavenumber space we write and it is given in units of .

To convert a spectral irradiance at wavelength to a spectral irradiance at wavenumber the following relation applies:

And if the units are not SI but rather given by the units shown above we have to account for a factor of 10 as:

## TOA Solar irradiance and solar constant¶

First, the TOA solar irradiance in wavelength space:

>>> from pyspectral.solar import (SolarIrradianceSpectrum, TOTAL_IRRADIANCE_SPECTRUM_2000ASTM)
>>> print("Solar irradiance = {}".format(round(solar_irr.solar_constant(), 3)))

The solar constant is in units of . Instead when expressing the irradiance in wavenumber space using wavenumbers in units of the solar flux is in units of :

>>> solar_irr = SolarIrradianceSpectrum(TOTAL_IRRADIANCE_SPECTRUM_2000ASTM, dlambda=0.0005, wavespace='wavenumber')
>>> print(round(solar_irr.solar_constant(), 5))
1366077.16482

## In-band solar flux¶

The solar flux (SI unit ) over a spectral sensor band can be derived by convolving the top of atmosphere solar spectral irradiance and the sensor relative spectral response. For band :

where is the TOA spectral solar irradiance at a sun-earth distance of one astronomical unit (AU).

In python code it may look like this:

>>> from pyspectral.rsr_reader import RelativeSpectralResponse
>>> from pyspectral.utils import convert2wavenumber, get_central_wave
>>> seviri = RelativeSpectralResponse('Meteosat-8', 'seviri')
>>> rsr, info = convert2wavenumber(seviri.rsr)
>>> print("Solar Irradiance (SEVIRI band VIS008) = {sflux:12.6f}".format(sflux=solar_irr.inband_solarflux(rsr['VIS0.8'])))
Solar Irradiance (SEVIRI band VIS008) = 63767.908405

Planck’s law describes the electromagnetic radiation emitted by a black body in thermal equilibrium at a definite temperature.

Thus for wavelength the Planck radiation or Blackbody radiation can be written as:

and expressed as a function of wavenumber :

In python it may look like this:

>>> from pyspectral.blackbody import blackbody_wn
>>> wavenumber = 90909.1
>>> rad = blackbody_wn((wavenumber, ), [300., 301])
0.001158 0.001175

Which are the spectral radiances in SI units at wavenumber around at temperatures 300 and 301 Kelvin. In units of this becomes:

>>> print("{0:7.4f} {1:7.4f}".format((rad*1e+5)[0], (rad*1e+5)[1]))
115.8354 117.5477

And using wavelength representation:

>>> from pyspectral.blackbody import blackbody
>>> wvl = 1./wavenumber
>>> rad = blackbody(wvl, [300., 301])
9573177.494 9714687.157

Which are the spectral radiances in SI units around at temperatures 300 and 301 Kelvin. In units of this becomes:

>>> print("{0:7.5f} {1:7.5f}".format((rad*1e-6)[0], (rad*1e-6)[1]))
9.57318 9.71469

## The inverse Planck function¶

Inverting the Planck function allows to derive the brightness temperature given the spectral radiance. Expressed in wavenumber space this becomes:

With the spectral radiance given as a function of wavelength the equation looks like this:

In python it may look like this:

>>> from pyspectral.blackbody import blackbody_wn_rad2temp
>>> wavenumber = 90909.1
>>> temp = blackbody_wn_rad2temp(wavenumber, [0.001158354, 0.001175477])
>>> print([round(t, 8) for t in temp])
[299.99998562, 301.00000518]

This approach only works for monochromatic or very narrow bands for which the spectral response function is assumed to be constant. In reality, typical imager channels are not that narrow and the spectral response function is not constant over the band. Here it is not possible to de-convolve the planck function and the spectral response function without knowing both, the spectral radiance and spectral response function in high spectral resolution. While this information is usually available for the spectral response function, there is only one integrated radiance per channel. That makes the derivation of brightness temperature from radiance more complicated and more time consuming - in preparation or in execution. Depending on individual requirements, there is a bunch of feasible solutions:

### Iterative Method¶

A stepwise approach, which starts with a guess (most common temperature), calculate the radiance that would correspond to that temperature and compare it with the measured radiance. If the difference lies above a certain threshold, adjust the temperature accordingly and start over again:

1. set uncertainty parameter
2. set
3. calculate
4. if then adjust and go back to
5. matches the measurement within the defined uncertainty
• no pre-computations
• accuracy easily adaptable to purpose
• memory friendly
• independent of band
• independent of spectral response function
• slow, especially when applying to wide bands and high accuracy requirements
• redundant calculations when applying to images with many pixels

### Function Fit¶

Another feasible approach is to fit a function in a way that minimizes. This requires pre-calculations of data pairs and . Finally an adequate function (dependent on the shape of ) is assigned and used to calculate the brightness temperature for one channel.

• fast approach (especially in execution)
• minor memory request (one function per channel)


text:
# DiamondNorm

 Other toolboxes required DiamondNorm Computes the diamond norm of a superoperator CVX CBNormInducedSchattenNormMaximumOutputFidelity Norms yes (convex)

DiamondNorm is a function that computes the diamond norm $\|\Phi\|_\diamond$ of a superoperator $\Phi$.

## Syntax

• DN = DiamondNorm(PHI)
• DN = DiamondNorm(PHI,DIM)

## Argument descriptions

• PHI: A superoperator. Should be provided as either a Choi matrix, or as a cell with either 1 or 2 columns (see the tutorial page for more details about specifying superoperators within QETLAB). PHIC will be a cell of Kraus operators if PHI is a cell of Kraus operators, and similarly PHIC will be a Choi matrix if PHI is a Choi matrix.
• DIM (optional, default has input and output spaces of equal dimension): A 1-by-2 vector containing the input and output dimensions of PHI, in that order (equivalently, these are the dimensions of the first and second subsystems of the Choi matrix PHI, in that order). If the input or output space is not square, then DIM's first row should contain the input and output row dimensions, and its second row should contain its input and output column dimensions. DIM is required if and only if PHI has unequal input and output dimensions and is provided as a Choi matrix.

## Examples

### A completely positive map

If $\Phi$ is completely positive then $\|\Phi\|_{\diamond} = \|\Phi^\dagger(I)\|$, where $I$ is the identity matrix, $\Phi^\dagger$ is the dual map of $\Phi$, and $\|\cdot\|$ is the usual operator norm, which we can verify in a special case via the following code:

>> Phi = {[1 2;3 4] ; [0 1;2 0] ; [1 1;-1 3]};
>> DiamondNorm(Phi)

ans =

37.6510

>> norm(ApplyMap(eye(2),DualMap(Phi)))

ans =

37.6510

### A difference of unitaries channel

If $\Phi(X) = X - UXU^\dagger$, then the diamond norm of $\Phi$ is the diameter of the smallest circle that contains the eigenvalues of $U$, which we can verify in a special case via the following code:

>> U = [1 1;-1 1]/sqrt(2);
>> Phi = {eye(2),eye(2); U,-U};
>> DiamondNorm(Phi)

ans =

1.4142

>> lam = eig(U)

lam =

0.7071 + 0.7071i
0.7071 - 0.7071i

>> abs(lam(1) - lam(2))

ans =

1.4142

### Can be used within CVX

The diamond norm is convex (like all norms) and this function can be used in the same way as any other convex function within CVX. Thus you can minimize the diamond norm or use the diamond norm in constraints of CVX optimization problems. For example, the following code finds the closest Pauli channel (i.e., channel with Kraus operators all of which are multiples of Pauli matrices) to a given 2-qubit channel, where the measure of "closest" is the diamond norm:

>> num_qubits = 2;
>> H = [1,1;1,-1]/sqrt(2); % Hadamard gate
>> Psi = ChoiMatrix({Tensor(H,num_qubits)}); % channel that acts as Hadamard gate on 2 qubits
>> cvx_begin sdp quiet
variable Phi(4^num_qubits,4^num_qubits) hermitian;
variable p(4^num_qubits);

minimize DiamondNorm(Phi - Psi)

subject to
% these constraints force Phi to be a Pauli channel
Phi == PauliChannel(p);
sum(p) == 1;
p >= 0;
cvx_end
cvx_optval

cvx_optval =

1.5000

## Source code

Click on "expand" to the right to view the MATLAB source code for this function.

1. %%  DIAMONDNORM    Computes the diamond norm of a superoperator
2. %   This function has one required input argument:
3. %     PHI: a superoperator
4. %
5. %   DN = DiamondNorm(PHI) is the diamond norm of the superoperator PHI. PHI
6. %   should be specified as either a cell with one or two columns of Kraus
7. %   operators, or as a Choi matrix (see online QETLAB tutorial for details
8. %   about specifying superoperators). If PHI is provided as a Choi matrix
9. %   with unequal input and output dimensions, a second argument specifying
10. %   the dimensions should also be provided (see below).
11. %
12. %   This function has one optional input argument:
13. %     DIM (default has both subsystems of equal dimension)
14. %
15. %   DN = DiamondNorm(PHI,DIM) is the diamond norm of PHI, as above, where
16. %   DIM is a 1-by-2 vector containing the input and output dimensions of
17. %   PHI, in that order (equivalently, these are the dimensions of the first
18. %   and second subsystems of the Choi matrix PHI, in that order).
19. %
20. %   URL: http://www.qetlab.com/DiamondNorm
21.
22. %   requires: ApplyMap.m, ComplementaryMap.m, ChoiMatrix.m, CVX
23. %             (http://cvxr.com/cvx/), DualMap.m, iden.m, IsCP.m,
24. %             IsHermPreserving.m, IsPSD.m, KrausOperators.m,
25. %             MaxEntangled.m, opt_args.m, PermuteSystems.m, Swap.m
26. %
27. %   author: Nathaniel Johnston (nathaniel@njohnston.ca), based on an
28. %           algorithm by John Watrous
29. %   package: QETLAB
30. %   last updated: April 26, 2016
31.
32. function dn = DiamondNorm(Phi,varargin)
33.
34. % If PHI is a CVX variable, assume it is already a Choi matrix and get its
35. % dimensions in a CVX-safe way.
36. if(isa(Phi,'cvx'))
37.     len_phi = length(Phi);
38.     sqrt_len = round(sqrt(len_phi));
39.
40.     % Set optional argument defaults: dim=sqrt_len
41.     [dim] = opt_args({ [sqrt_len,sqrt_len] },varargin{:});
42.
43. % If PHI is not a CVX variable, we can get its dimensions a bit more
44. % robustly and allow Kraus operator input. We can also implement some
45. % speed-ups like computing the diamond norm of a completely positive map
46. % exactly.
47. else
48.     Phi = KrausOperators(Phi,varargin{:});
49.     [dim] = opt_args({ [size(Phi{1,1},2),size(Phi{1,1},1)] },varargin{:});
50.     len_phi = dim(1)*dim(2);
51.
52.     two_cols = (size(Phi,2) > 1);
53.     if(two_cols && ((size(Phi{1,2},2) ~= dim(1) || size(Phi{1,2},1) ~= dim(2))))
54.         error('DiamondNorm:InvalidDim','The input and output spaces of PHI must both be square.');
55.     end
56.
57.     % The diamond norm of a CP map is trivial to compute.
58.     if(~two_cols || IsCP(Phi))
59.         dn = norm(ApplyMap(speye(dim(2)),DualMap(Phi)));
60.         return
61.     end
62.
63.     Phi = ChoiMatrix(Phi);
64. end
65.
66. % This SDP has two advantages over the other SDP for the diamond norm:
67. % it works in a CVX-safe way that allows this function to be used within
68. % other CVX optimization problems, and it has better numerical accuracy.
69. % The downside is that it is slightly slower for channels with few Kraus
70. % operators.
71. cvx_begin sdp quiet
72.     cvx_precision best;
73.     variable Y0(len_phi,len_phi) hermitian
74.     variable Y1(len_phi,len_phi) hermitian
75.     minimize norm(PartialTrace(Y0,2,dim)) + norm(PartialTrace(Y1,2,dim))
76.     subject to
77.         cons = [Y0,-Phi;-Phi',Y1];
78.         cons + cons' >= 0; % avoid some numerical problems: CVX often thinks things aren't symmetric without this
79.         Y0 >= 0;
80.         Y1 >= 0;
81. cvx_end
82.
83. dn = cvx_optval/2;


text:
# MDC-2 recommended IV values?

I'm currently reading Menezes' "Handbook of Applied Cryptography", and in it, when describing the MDC-2 cryptographic hash function, has the following line:

Choose the 64-bit non-secret constants $IV$, $\widehat{IV}$ (the same constants must be used for MDC verification) from a set of recommended prescribed values. A default set of prescribed values is (in hexadecimal): $IV = 0x5252525252525252, \widehat{IV} = 0x2525252525252525$.

My questions are firstly, is it OK to use these "default" values more than once (as implied by the word "default")? And secondly, is there a full list and reasoning for these prescribed values? I cannot find the MDC-2 specification and so was hoping someone here would know more about it.

## 1 Answer

You can use those values more than once and there isn't much of a reason to choose another pair – except longer values for a cipher with a larger block size.

The only real requirement for the values is that they differ. However, if someone found a fixed point or other cycle for MDC-2 with a given block cipher, they could choose that point as an IV and be able to generate collisions for any string. That's why using a pair of non-suspicious nothing-up-my-sleeve numbers is better.


text:
# How can I link together outline-mode with RefTeX-TOC?

The question title says it, pretty much.

How can I link together RefTeX's TOC functionality with outline-mode such that I can fold sections/subsections/etc.?

• Does this help? – giordano Feb 18 '14 at 23:56
• @giordano Not quite, it would seem. I tested out the baked-in functionality you linked to, but it would not fold \subsections under \sections, as I would have expected. (Am I confusing outline-mode with org-mode?) – Sean Allred Feb 19 '14 at 0:51
• org-mode is something like outline-mode on steroids :-) How do you expect \subsections to be folded? – giordano Feb 19 '14 at 1:05
• @giordano has hit the nail on the head -- i.e., we need the beginning and ending regexp of the region you want to fold. – lawlist Feb 19 '14 at 3:23
• @giordano Consider \sections S and \subsections o (continuing the pattern down the hierarchy): SooSooooSoSooo could be folded into S...SooooSoSooo or S...S...SoS..., etc. To establish the pattern: CSSooSooSSoo -> CSS...S...SS... -> C.... (where each ... is an org-like continuation line) – Sean Allred Feb 21 '14 at 2:37

INITIAL DRAFT (February 19, 2014):   First rough draft.

EDIT (February 20, 2014):  Consolidated both functions into just one. Added a variable beg-flag-regexp and revised the logic of the function in relation thereto. The function now examines the beginning regexp to determine the matching ending regexp; and, it will work with the format of \begin{anything} and \end{anything} -- provided (of course) that anything is the same for both begin and end. The function now takes into consideration the possibility that there may be several occurrences on the same line matching the beg-flag-regexp -- e.g., \begin{minipage}\begin{singlespace*} -- i.e., selection is based upon proximity to the cursor position.

The following is a demonstration of how code folding works in Emacs. Code folding requires that there be a defined regexp for the beginning and ending of the folded region.

(defvar beg-flag-regexp (concat
"\$$\\\\begin\{\$$\$$" "[^}]*" "\$$\$$\}\$$" )
"Regexp matching the beginning of the folded region.")

(defun toggle-block ()
"When FLAG is non-nil, hide the region.  Otherwise make it visible.  For this
function to work, the cursor must be on the same line as the beginning regexp."
(interactive)
(require 'outline)
(cond
((or
;; sweet-spot
(looking-at beg-flag-regexp)
;; point could be between backslash and before the letter n
(let ((line-begin (save-excursion (beginning-of-line 1) (point))))
(save-excursion
(re-search-backward "\\\\" line-begin t)
(looking-at beg-flag-regexp)))
;; point could be to the right of \begin
(let ((line-begin (save-excursion (beginning-of-line 1) (point))))
(save-excursion
(re-search-backward "\\\\begin" line-begin t)
(looking-at beg-flag-regexp)))
;; point could be to the left of \begin
(let ((line-end (save-excursion (end-of-line 1) (point))))
(save-excursion
(re-search-forward "\\\\begin" line-end t)
(backward-char 6)
(looking-at beg-flag-regexp))))
(let* (
(flag (not (get-char-property (match-end 0) 'invisible)))
(beg (match-end 0))
end
(base-flag-match (regexp-quote
(buffer-substring-no-properties (match-beginning 2) (match-end 2))))
(end-flag-match (concat "\\\\end\{" base-flag-match "\}"))
(go-fish (concat "\\begin\{" base-flag-match "\}"))  )
(save-excursion
(if (re-search-forward end-flag-match nil t)
(progn
(setq end (point))
(outline-flag-region beg end flag)
(cond
(flag
(overlay-put (make-overlay beg end) 'display "\u25be"))
(t
(mapc 'delete-overlay (overlays-in beg end)))))
(user-error "Error locating an ending match for:  %s." go-fish)))
(if (> (point) beg)
(goto-char beg)) ))
(t
(message "Sorry, you are not on a line containing the beginning regexp."))))

• This is certainly useful to get the job done, but how might I define Emacs-flavored regular expressions to match what needs to be matched? – Sean Allred Feb 21 '14 at 2:33
• My understanding is that AUCTeX has a bunch of gizmos built in to do some folding; however, I have finally liberated myself completely from that package and never really learned it well. For my example above, I used the most common situation I could think of (e.g., begin/end anything). I essentially only do two types of documents -- letters and legal pleadings, so my LaTeX knowledge is somewhat limited. If you have an example of something that has a specific beginning and a specific ending, then I'd be happy to take a stab at it. I would need to see it laid out so that I can visualize it. – lawlist Feb 21 '14 at 3:11


text:
I am not the admin or the owner of the project, I don’t know the admin!

View / Sign-Up

PLANS:
120% after 60 days

PAYMENT PROCESSORS:
Perfect Money

PROGRAM DETAILS:

Minimum Investment:
US\$ 10
Maximum Investment:
US\$ 500
Referral:
2%

Start of Monitoring:
31.12.2020

View / Sign-Up

## linux – why do I get a locale error even thougfh it is set?

When I run bitbake, I’m getting the following:

\$ bitbake core-image-base
Please use a locale setting which supports utf-8.
Python can't change the filesystem locale after loading so we need a utf-8 when python starts or things won't work.

even though my locale is set to en_US.UTF-8, why is this?

\$ echo \$LC_ALL
en_US.UTF-8

## schedule meeting in Teams from sharepoint portal

There is no out of the box capability to do this with SharePoint Server. You would need to create something like a [Remote] Event Receiver that called the Graph API to CreateEvent with an online meeting.

Since your question is general and open ended, investigate this method and come back with specific questions you might have.

## postgresql 10 – Cancelling an upgrade/migration from Postgre 10 to 12

I’m using these command to upgrade, it runs well until 9GB it became really slow:

# sudo pg_dropcluster 12 main --stop
Restarting old cluster with restricted connections...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Creating new PostgreSQL cluster 12/main ...
/usr/lib/postgresql/12/bin/initdb -D /var/lib/postgresql/12/main --auth-local peer --auth-host md5 --encoding UTF8 --lc-collate en_CA.UTF-8 --lc-ctype en_CA.UTF-8
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locales
COLLATE:  en_CA.UTF-8
CTYPE:    en_CA.UTF-8
MESSAGES: C.UTF-8
MONETARY: C.UTF-8
NUMERIC:  C.UTF-8
TIME:     C.UTF-8
The default text search configuration will be set to "english".

Data page checksums are disabled.

fixing permissions on existing directory /var/lib/postgresql/12/main ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... posix
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Jakarta
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok

Success. You can now start the database server using:

pg_ctlcluster 12 main start

Ver Cluster Port Status Owner    Data directory              Log file
12  main    5434 down   postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log

Starting new cluster...
Notice: extra pg_ctl/postgres options given, bypassing systemctl for start operation
Roles, databases, schemas, ACLs...
set_config
------------

(1 row)

set_config
------------

(1 row)

set_config
------------

(1 row)

set_config
------------

(1 row)

Fixing hardcoded library paths for stored procedures...
Analyzing database postgres...
Fixing hardcoded library paths for stored procedures...
Analyzing database template1...
Fixing hardcoded library paths for stored procedures...

The watch:

Every 2.0s: df -t ext4 -h ; du -s /var/lib/postgresql/10 /var/lib/postgresql/12/                                    data: Fri Jan  1 02:21:03 2021

Filesystem      Size  Used Avail Use% Mounted on
/dev/vda1        56G   32G   22G  60% /
/dev/vdb1        98G   73G   21G  78% /mnt/vdb1
11376348        /var/lib/postgresql/10
9466976 /var/lib/postgresql/12/
# ps -e -o pcpu,pmem,rss,comm,args --sort=pcpu | grep postgres
0.0  0.0  3404 postgres        postgres: 10/main: logger process
0.0  0.5 23684 postgres        postgres: 10/main: checkpointer process
0.0  0.2 12044 postgres        postgres: 10/main: writer process
0.0  0.5 20260 postgres        postgres: 10/main: wal writer process
0.0  0.1  5608 postgres        postgres: 10/main: autovacuum launcher process
0.0  0.0  3812 postgres        postgres: 10/main: stats collector process
0.0  0.0  4004 postgres        postgres: 10/main: bgworker: logical replication launcher
0.0  0.5 23976 postgres        /usr/lib/postgresql/12/bin/postgres -D /var/lib/postgresql/12/main -c config_file=/etc/postgresql/12/main/postgresql.conf -c hba_file=/tmp/pg_hba.LVD6EB.conf
0.0  0.3 12348 postgres        postgres: 12/main: autovacuum launcher
0.0  0.1  6732 postgres        postgres: 12/main: logical replication launcher
0.0  0.0   672 grep            grep --color=auto postgres
0.1  1.3 52672 postgres        /usr/lib/postgresql/10/bin/postgres -D /var/lib/postgresql/10/main -c config_file=/etc/postgresql/10/main/postgresql.conf -c hba_file=/tmp/pg_hba.LVD6EB.conf
0.1  0.1  5716 postgres        postgres: 12/main: stats collector
0.2  0.0  3848 watch           watch -dc df -t ext4 -h ; du -s /var/lib/postgresql/10 /var/lib/postgresql/12/
0.4  3.5 144416 postgres       postgres: 12/main: checkpointer
1.1  3.5 141528 postgres       postgres: 12/main: background writer
2.2  0.2  8392 pg_restore      /usr/lib/postgresql/12/bin/pg_restore -h /var/run/postgresql -p 5434 --data-only -d geo --disable-triggers --no-data-for-failed-tables
2.3  0.2  9884 postgres        postgres: 12/main: walwriter
11.4  0.3 14160 pg_dump         /usr/lib/postgresql/12/bin/pg_dump -h /var/run/postgresql -p 5432 -Fc --quote-all-identifiers geo
19.1 27.0 1089624 postgres      postgres: 10/main: postgres geo (local) COPY
55.9  3.8 155360 postgres       postgres: 12/main: postgres geo (local) COPY

The question is.. if I cancel the upgrade (Ctrl+C) since it’s already take too much time unlike when I upgrade postgresql 9.6 to 10 that only less than an hour with similar dataset (and not sure when it will end, there’s 2 hours of data loss/not inserted because of upgrading), what would be happened? (I have 1GB xz-ed backup from 2 hours ago)

EDIT

apparently it’s migrating on another folder too (I put some other tablespace on different directory back then because of running out of main partition space), so it’s progressing well and doesn’t stuck:

# du -s /mnt/vdb1/pgdata2/*/
41035516        /mnt/vdb1/pgdata2/PG_10_201707211/
26548836        /mnt/vdb1/pgdata2/PG_12_201909212/

UPDATE

it’s completed around 3 hours for 39 GB of data ‘__’)

## bitcoind – Failed to start bitcoin daemon using Ubuntu 20.04

Hey I keep getting this error everytime I run sudo systemctl enable –now bitcoind

Job for bitcoind.service failed because the control process exited with error code.
See “systemctl status bitcoind.service” and “journalctl -xe” for details.

When I input sudo journalctl -xe –unit bitcoind I get this.
bitcoind.service – Bitcoin daemon
Active: failed (Result: exit-code) since Wed 2020-12-30 15:12:05 UTC; 23s >
Process: 2411 ExecStartPre=/bin/chgrp admin /etc/bitcoin (code=exited, stat>

Here is how my bitcoind.service looks. I changed the user and group from bitcoin to admin.
(Unit)
Description=Bitcoin daemon
After=network.target

(Service)
ExecStart=/usr/bin/bitcoind -daemon
-pid=/run/bitcoind/bitcoind.pid
-conf=/etc/bitcoin/bitcoin.conf

PermissionsStartOnly=true

####################

Type=forking
PIDFile=/run/bitcoind/bitcoind.pid
Restart=on-failure
TimeoutStopSec=600

RuntimeDirectory=bitcoind
RuntimeDirectoryMode=0710

ConfigurationDirectory=bitcoin
ConfigurationDirectoryMode=0710

StateDirectory=bitcoind
StateDirectoryMode=0710

####################

PrivateTmp=true

ProtectHome=true

ProtectSystem=full

NoNewPrivileges=true

PrivateDevices=true

MemoryDenyWriteExecute=true

(Install)
WantedBy=multi-user.target

Here are the steps I made before:
~\$ cd src
~/src\$ git clone –depth 1 –branch v0.20.1 https://github.com/bitcoin/bitcoin.git
~/src\$ cd bitcoin
~/src/bitcoin\$ ./contrib/install_db4.sh pwd
~/src/bitcoin\$ ./autogen.sh
~/src/bitcoin\$ export BDB_PREFIX=’/home/ubuntu/src/bitcoin/db4′
~/src/bitcoin\$ ./configure BDB_LIBS=”-L\${BDB_PREFIX}/lib -ldb_cxx-4.8″ BDB_CFLAGS=”-I\${BDB_PREFIX}/include”
~/src/bitcoin\$ make
~/src/bitcoin\$ sudo make install
~/src/bitcoin\$ bitcoind -version
vi bitcoin.conf
server=1
rpcbind=127.0.0.1
whitelist=127.0.0.1
rpcallowip=127.0.0.1/32
zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

~\$ sudo mkdir -p /etc/bitcoin
~\$ sudo cp bitcoin.conf /etc/bitcoin
~\$ sudo chmod 644 /etc/bitcoin/bitcoin.conf

Utimately I got
ubuntu systemd(1): Failed to start Bitcoin daemon.

## vector calculus – Numerically solving 3D Maxwell equations with NDEigensystem

I am trying to get electric $$vec{E}$$ and magnetic $$vec{B}$$ fields in a cylindrical cavity with a dielectric, as in the following Figure. .

Both the cavity (pink) and dielectric (blue, with dielectric constant epsilon_r) are cylindrical and share the main axis. The cavity is assumed to be conducting, such as the field at its surface has to be null.

By resorting to the vector potential $$vec{A}$$, and using the generalized Coulomb Gauge transformation such that:

$$vec{E}(t,vec{r})=-partial_t vec{A}(t,vec{r}),$$

$$vec{B}(t,vec{r})=vec{nabla} times vec{A}(t,vec{r}),$$

$$vec{nabla} cdot left( epsilon_r(vec{r}) vec{A}(t,vec{r}) right)= 0,$$

I got the system of differential equations that $$vec{A}$$ has to satisfy:
$$begin{equation} vec{nabla}^2 vec{A}(t,vec{r}) – frac{1 + epsilon_r(vec{r})}{c^2}partial_t^2 vec{A}(t,vec{r})=0. end{equation}$$
Here, $$vec{r} = (x,y,z)$$.

I would like to have the eigenfrequencies and (spatial) eigenfunctions of this last operator. As far as I have understood, NDEigensystem with DirichletCondition is what I have to use; with the first output being the frequencies of the modes and the second output the spatial envelopes of the eigenfunctions.

I tried that, and failed (quite miserably). Not only the eigenfrequencies are imaginary and the spatial envelopes of the eigenfunctions do have an imaginary part$$^{*}$$. If I plug the outcome of NDEigensystem into the differential equations, I find that these equations are not even satisfied. I am sure that it is me failing somewhere, but after long time spent trying, I am starting being really frustrated. My code is the following:

{vals, funs} = NDEigensystem({EqSt(t, x, y, z, z1, z2, e, c) == {0, 0, 0}, BndCnd}, {Ax(t, x, y, z), Ay(t, x, y, z), Az(t, x, y, z)}, t, {x, y, z} (Element) Cylinder({{0, 0, 0}, {0, 0, d}}, r), 16, Method -> {"PDEDiscretization" -> {"FiniteElement", "MeshOptions" -> {"MaxCellMeasure" -> 0.01}}}});

where EqSt(t, x, y, z, z1, z2, e, c) is the system of differential equations

EqSt(t_, x_, y_, z_, z1_, z2_, er_, c_) := Laplacian({Ax(t, x, y, z), Ay(t, x, y, z), Az(t, x, y, z)}, {x, y, z}) - (1 + fer(z, z1, z2, er))/c^2 {D(Ax(t, x, y, z), {t, 2}), D(Ay(t, x, y, z), {t, 2}), D(Az(t, x, y, z), {t, 2})};

and BndCnd the boundary conditions

BndCnd = {DirichletCondition(Ax(t, x, y, z) == 0, True), DirichletCondition(Ay(t, x, y, z) == ,True), DirichletCondition(Az(t, x, y, z) == 0, True)};

Finally, the dielectric function fer(z, z1, z2, er) that I use to mimic the dielectric is the following:

fer(z_, z1_, z2_, e_) := e (HeavisideTheta(z - z1) - HeavisideTheta(z - z2));

which is a step function in the z-th coordinate (= the axis of both cylinders) having value e betweem z1 and z2 and zero elsewhere.

I have tried different methods and different values of “MaxCellMeasure” (there is little improvement, but the error which I obtain by plugging the solution into the differential equations is above one!!!). Do you have any idea what is wrong here?

I have few “bonus questions” here.

-First, I tried increasing the mesh resolution for getting better outcomes, but all the times the eigenfunctions look quite bad, not smooth at all. I guess that a 3D mesh is quite demanding, but I know that the most difficult part is going to be at the dielectric. How can I tell NDEigensystem to have a finer mesh there?

-Second, there is a way to change the normalization of the eigenfunctions? I have read that NDEigensystem spits out eigenfunctions $$vec{phi}_i$$ s.t.: $$int vec{phi}_i^* cdot vec{phi}_j d vec{r} = delta_i,j$$. I would change that to $$int epsilon_r(vec{r}) vec{phi}_i^* cdot vec{phi}_j d vec{r} = delta_i,j$$, would this be possible?

-Finally, I guess that it might be easier for NDEigensolver to remove the time dependence from the differential equations. This can be easily done by assuming that $$vec{A}(t,vec{r}) rightarrow vec{A}(vec{r})e^{-i omega t})$$. In this case, one can rewrite the operator equation above as:
$$begin{equation} vec{nabla}^2 vec{A}(vec{r}) + frac{omega^{2}}{c^2}(1 + epsilon_r(vec{r})) vec{A}(vec{r})=0. end{equation}$$
However, I do not know how to tell NDEigensystem that $$omega$$ is not a parameter, but should be found with the system constraints… There is a way to remove the time dependence from the equation to be given in NDEigensystem?

$$^*$$I guess this is a stupid problem; if I change the sign of the Laplacian I get real eigenfrequencies and eigenfunctions… But I am quite confident that the sign in the above equation is correct. There is something that I am missing here?

## HELP! Domain Registrar CLosed

I have no idea what to do, but I have a domain name that was managed under my account at ITITCH.COM

## dnd 5e – Can an Eldritch Knight Attack Twice With Green Flame Blade and War Magic?

An 8th-level Eldritch Knight has a sword.

The War Magic class ability says:

When you use your action to cast a cantrip, you can make one weapon attack as a bonus action

And the cantrip Green Flame Blade says:

You brandish the weapon used in the spell’s casting and make a melee attack with it against one creature within 5 feet of you

So I think that means there are 2 sword attacks in total for that turn.

One attack is a bonus action, and one is a side effect of the cantrip. In addition to that are the flame effects of the cantrip as well.

(The 2 attacks are not related to the Extra Attack Fighter class ability, which requires taking the Attack action, which is not being done here.)

Is the above information correct?

## macbook pro – Trackpad gestures not working

Some of my macbook trackpad gestures are not working, such as open the launchpad using 4 fingers; show the desktop; and enlarge images using 2 finger pinch. I’m sure all of those functions are enabled in the system preference.

Other gestures are working normally, such as to swipe between applications using 3 fingers; go back and forth in browsers using 2 fingers, etc.

I guess it’s those gestures requiring using the “pinch” action are not working and everything else seem to be fine. Could you please tell me how to fix this problem? Many thanks!

## How can I change my Windows 10 user name?

I am setting up a new PC with Windows 10 Pro and I mistakenly logged in with my Microsoft Account. That set me up with an administrator account with a user name made up of the first 5 characters of my email address. But my old PC has a user name which is my first name. I have several file handling utilities that rely on a directory structure of C:/User/, where is my first name. I’ve tried googling and tried several suggestions, but none lead to a place to actually change the name. I did find one way to rename my user name on my MS account site, except that it changes my email address as well. I’m thinking that I have to run Refresh to install Windows again so that I can bypass the log in to Microsoft and create a local account. But a Refresh saves my settings, does that include my account and user name? Or am I asked to do that again so that I can skip it this time.? Is a Refresh a viable way? It won’t be too hard, I’ve only installed a few apps and I can do those over again. Does a refresh change the vendor’s drivers? I’m at a loss. Thanks for any help.


text:
×
Algebra

# Polynomial Interpolation: Level 5 Challenges

Consider the following system of linear equations: $\begin{cases} 1&+&a&+&b&+&c&+&d&+&e&=&1,\\ 32&+&16a&+&8b&+&4c&+&2d&+&e&=&2,\\ 243&+&81a&+&27b&+&9c&+&3d&+&e&=&3,\\ 1024&+&256a&+&64b&+&16c&+&4d&+&e&=&4,\\ 3125&+&625a&+&125b&+&25c&+&5d&+&e&=&5.\\ \end{cases}$

Evaluate $\left|\dfrac{8bcd}{125ae}\right|.$

A polynomial $$f(x)$$ has degree $$8$$ and $$f(i)=2^i$$ for $$i=0,1,2,3,4,5,6,7,8.$$

Find $$f(9).$$

Let $$a,b,c$$ be complex numbers satisfying

$$(a+1)(b+1)(c+1) = 1$$

$$(a+2)(b+2)(c+2) = 2$$

$$(a+3)(b+3)(c+3) = 3$$

Find $$(a+4)(b+4)(c+4)$$.

Find the number of positive integers $$n$$ such that $$2 \leq n \leq 100$$ and there exists a polynomial $$f(x)$$ with real coefficients and degree $$<n$$ such that for all integers $$x,$$ $$f(x)$$ is an integer if and only if $$x$$ is not a multiple of $$n.$$

Suppose $$f(x)$$ is a degree $$8$$ polynomial such that $$f(2^i)=\frac{1}{2^i}$$ for all integers $$0 \leq i \leq 8$$. If $$f(0)= \frac{a}{b}$$, where $$a$$ and $$b$$ are coprime positive integers, what is the value of $$a+b$$?

×