text:
package org.apache.flink.types.parser;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.types.BooleanValue;
import org.apache.flink.types.ByteValue;
import org.apache.flink.types.DoubleValue;
import org.apache.flink.types.FloatValue;
import org.apache.flink.types.IntValue;
import org.apache.flink.types.LongValue;
import org.apache.flink.types.ShortValue;
import org.apache.flink.types.StringValue;

import java.math.BigDecimal;
import java.math.BigInteger;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;

/**
 * A FieldParser is used parse a field from a sequence of bytes. Fields occur in a byte sequence and
 * are terminated by the end of the byte sequence or a delimiter.
 *
 *
The parsers do not throw exceptions in general, but set an error state. That way, they can be
 * used in functions that ignore invalid lines, rather than failing on them.
 *
 * @param <T> The type that is parsed.
 */
@PublicEvolving
public abstract class FieldParser<T> {

    /** An enumeration of different types of errors that may occur. */
    public static enum ParseErrorState {
        /** No error occurred. */
        NONE,

        /** The domain of the numeric type is not large enough to hold the parsed value. */
        NUMERIC_VALUE_OVERFLOW_UNDERFLOW,

        /** A stand-alone sign was encountered while parsing a numeric type. */
        NUMERIC_VALUE_ORPHAN_SIGN,

        /** An illegal character was encountered while parsing a numeric type. */
        NUMERIC_VALUE_ILLEGAL_CHARACTER,

        /** The field was not in a correct format for the numeric type. */
        NUMERIC_VALUE_FORMAT_ERROR,

        /** A quoted string was not terminated until the line end. */
        UNTERMINATED_QUOTED_STRING,

        /** The parser found characters between the end of the quoted string and the delimiter. */
        UNQUOTED_CHARS_AFTER_QUOTED_STRING,

        /** The column is empty. */
        EMPTY_COLUMN,

        /** Invalid Boolean value * */
        BOOLEAN_INVALID
    }

    private Charset charset = StandardCharsets.UTF_8;

    private ParseErrorState errorState = ParseErrorState.NONE;

    /**
     * Parses the value of a field from the byte array, taking care of properly reset the state of
     * this parser. The start position within the byte array and the array's valid length is given.
     * The content of the value is delimited by a field delimiter.
     *
     * @param bytes The byte array that holds the value.
     * @param startPos The index where the field starts
     * @param limit The limit unto which the byte contents is valid for the parser. The limit is the
     *     position one after the last valid byte.
     * @param delim The field delimiter character
     * @param reuse An optional reusable field to hold the value
     * @return The index of the next delimiter, if the field was parsed correctly. A value less than
     *     0 otherwise.
     */
    public int resetErrorStateAndParse(
            byte[] bytes, int startPos, int limit, byte[] delim, T reuse) {
        resetParserState();
        return parseField(bytes, startPos, limit, delim, reuse);
    }

    /** Each parser's logic should be implemented inside this method */
    protected abstract int parseField(byte[] bytes, int startPos, int limit, byte[] delim, T reuse);

    /**
     * Reset the state of the parser. Called as the very first method inside {@link
     * FieldParser#resetErrorStateAndParse(byte[], int, int, byte[], Object)}, by default it just
     * reset its error state.
     */
    protected void resetParserState() {
        this.errorState = ParseErrorState.NONE;
    }

    /**
     * Gets the parsed field. This method returns the value parsed by the last successful invocation
     * of {@link #parseField(byte[], int, int, byte[], Object)}. It objects are mutable and reused,
     * it will return the object instance that was passed the parse function.
     *
     * @return The latest parsed field.
     */
    public abstract T getLastResult();

    /**
     * Returns an instance of the parsed value type.
     *
     * @return An instance of the parsed value type.
     */
    public abstract T createValue();

    /**
     * Checks if the delimiter starts at the given start position of the byte array.
     *
     *
Attention: This method assumes that enough characters follow the start position for the
     * delimiter check!
     *
     * @param bytes The byte array that holds the value.
     * @param startPos The index of the byte array where the check for the delimiter starts.
     * @param delim The delimiter to check for.
     * @return true if a delimiter starts at the given start position, false otherwise.
     */
    public static final boolean delimiterNext(byte[] bytes, int startPos, byte[] delim) {

        for (int pos = 0; pos < delim.length; pos++) {
            // check each position
            if (delim[pos] != bytes[startPos + pos]) {
                return false;
            }
        }
        return true;
    }

    /**
     * Checks if the given bytes ends with the delimiter at the given end position.
     *
     * @param bytes The byte array that holds the value.
     * @param endPos The index of the byte array where the check for the delimiter ends.
     * @param delim The delimiter to check for.
     * @return true if a delimiter ends at the given end position, false otherwise.
     */
    public static final boolean endsWithDelimiter(byte[] bytes, int endPos, byte[] delim) {
        if (endPos < delim.length - 1) {
            return false;
        }
        for (int pos = 0; pos < delim.length; ++pos) {
            if (delim[pos] != bytes[endPos - delim.length + 1 + pos]) {
                return false;
            }
        }
        return true;
    }

    /**
     * Sets the error state of the parser. Called by subclasses of the parser to set the type of
     * error when failing a parse.
     *
     * @param error The error state to set.
     */
    protected void setErrorState(ParseErrorState error) {
        this.errorState = error;
    }

    /**
     * Gets the error state of the parser, as a value of the enumeration {@link ParseErrorState}. If
     * no error occurred, the error state will be {@link ParseErrorState#NONE}.
     *
     * @return The current error state of the parser.
     */
    public ParseErrorState getErrorState() {
        return this.errorState;
    }

    /**
     * Returns the end position of a string. Sets the error state if the column is empty.
     *
     * @return the end position of the string or -1 if an error occurred
     */
    protected final int nextStringEndPos(byte[] bytes, int startPos, int limit, byte[] delimiter) {
        int endPos = startPos;

        final int delimLimit = limit - delimiter.length + 1;

        while (endPos < limit) {
            if (endPos < delimLimit && delimiterNext(bytes, endPos, delimiter)) {
                break;
            }
            endPos++;
        }

        if (endPos == startPos) {
            setErrorState(ParseErrorState.EMPTY_COLUMN);
            return -1;
        }
        return endPos;
    }

    /**
     * Returns the length of a string. Throws an exception if the column is empty.
     *
     * @return the length of the string
     */
    protected static final int nextStringLength(
            byte[] bytes, int startPos, int length, char delimiter) {
        if (length <= 0) {
            throw new IllegalArgumentException("Invalid input: Empty string");
        }
        int limitedLength = 0;
        final byte delByte = (byte) delimiter;

        while (limitedLength < length && bytes[startPos + limitedLength] != delByte) {
            limitedLength++;
        }

        return limitedLength;
    }

    /**
     * Gets the character set used for this parser.
     *
     * @return the charset used for this parser.
     */
    public Charset getCharset() {
        return this.charset;
    }

    /**
     * Sets the character set used for this parser.
     *
     * @param charset charset used for this parser.
     */
    public void setCharset(Charset charset) {
        this.charset = charset;
    }

    // --------------------------------------------------------------------------------------------
    //  Mapping from types to parsers
    // --------------------------------------------------------------------------------------------

    /**
     * Gets the parser for the type specified by the given class. Returns null, if no parser for
     * that class is known.
     *
     * @param type The class of the type to get the parser for.
     * @return The parser for the given type, or null, if no such parser exists.
     */
    public static <T> Class<FieldParser<T>> getParserForType(Class<T> type) {
        Class<? extends FieldParser<?>> parser = PARSERS.get(type);
        if (parser == null) {
            return null;
        } else {
            @SuppressWarnings("unchecked")
            Class<FieldParser<T>> typedParser = (Class<FieldParser<T>>) parser;
            return typedParser;
        }
    }

    private static final Map<Class<?>, Class<? extends FieldParser<?>>> PARSERS =
            new HashMap<Class<?>, Class<? extends FieldParser<?>>>();

    static {
        // basic types
        PARSERS.put(Byte.class, ByteParser.class);
        PARSERS.put(Short.class, ShortParser.class);
        PARSERS.put(Integer.class, IntParser.class);
        PARSERS.put(Long.class, LongParser.class);
        PARSERS.put(String.class, StringParser.class);
        PARSERS.put(Float.class, FloatParser.class);
        PARSERS.put(Double.class, DoubleParser.class);
        PARSERS.put(Boolean.class, BooleanParser.class);
        PARSERS.put(BigDecimal.class, BigDecParser.class);
        PARSERS.put(BigInteger.class, BigIntParser.class);

        // value types
        PARSERS.put(ByteValue.class, ByteValueParser.class);
        PARSERS.put(ShortValue.class, ShortValueParser.class);
        PARSERS.put(IntValue.class, IntValueParser.class);
        PARSERS.put(LongValue.class, LongValueParser.class);
        PARSERS.put(StringValue.class, StringValueParser.class);
        PARSERS.put(FloatValue.class, FloatValueParser.class);
        PARSERS.put(DoubleValue.class, DoubleValueParser.class);
        PARSERS.put(BooleanValue.class, BooleanValueParser.class);

        // SQL date/time types
        PARSERS.put(java.sql.Time.class, SqlTimeParser.class);
        PARSERS.put(java.sql.Date.class, SqlDateParser.class);
        PARSERS.put(java.sql.Timestamp.class, SqlTimestampParser.class);
    }
}

redpajama_set_name: RedPajamaGithub


Western Waukesha Dog Training Club is dedicated to helping you train your dog from a rambunctious puppy to a well-behaved member of your family and to the highest level of competition. Training your dog not only adds to the enjoyment of owning a dog, but also contributes to a strong and lasting bond. In addition to training, we offer a wide variety of fun, exciting and educational events for you and your dog to share.
Read our most recent (and previous) editions of The Recall, our bi-monthly newsletter, in our Newsletter Archive.
Linda Koutsky Seminar: "Position Changes"


text:
Euro 2020 host bids spain vs. sweden
Jun 09, 2019 · Spain vs Sweden.
Alvaro Morata is the team's top goalscorer with four goals. Oct 16, 2019 · Euro 2020 Qualifiers: Sweden Vs Spain: Player Ratings And Review. Euro 2020 qualifiers: Spain qualify to the Euro 2020 after a 1-1 draw with Sweden sawy from home. Rodrigo scored at the death as De Gea got himself injured. Spain confirmed their qualification to Euro 2020 with a draw against Sweden on October 16, 2019. Jun 09, 2019 · Spain vs Sweden. Spain will host Sweden on Monday in a tasty Euro 2020 qualifying between two teams that made the knockout stage of the last World Cup. As part of the fourth matchday, these Group F teams and Euro hopefuls fight to finish the day in first place.
Spain are facing a potential Covid-19 outbreak as they prepare for their Euro 2020 opening game against Sweden on Monday.
Sweden football match. Euro 2020 will kick off on June 11, a year later than billed. Here are all the final 26-man squads, which have been increased due to COVID - LIVE - Spain vs Sweden: Luis Enrique's new-look team aiming for perfect start in Group E in bid for record fourth Euros trophy against in-form Swedes in The bidding process for the UEFA Euro 2020 is the process by which the location for the 16th European Championship, commonly referred to as Euro 2020, was selected.
The host side is a -238 favourite with the Swedes at +580 and a draw +300 on the soccer odds. Spain vs. Sweden Euro 2020 Betting Odds
"We had the European Championship Ladies Final at the Friends Arena and received positive signals. This is surprising." The Euros usually take Sweden, meanwhile is hoping to make a big step toward qualification from the group stage by a win against their hosts today. The two teams Spain and Portugal made their bid to host the 2030 World Cup official on in Madrid, ahead of a Euro 2020 warm-up between the two nations. Three-time winners Spain will be looking to make a successful start to Euro 2020 as they bid for a record fourth European Championship. They'll Spain vs Sweden LIVE Score, EURO 2020 Match Today Updates: Host dominates early on. ESP vs SWE, Euro 2021 LIVE Updates: Presenting Assessing La Roja's squad for Euro 2020 of Euro 2016 before getting knocked out of the 2018 FIFA World Cup by hosts Russia.
Simply click on the name of the city to expand for more info… Data: UEFA; Chart: Michelle McGhee/AxiosThe UEFA European Championship, still called Euro 2020 despite a one-year delay, kicks off today as Italy hosts Turkey at Rome's Stadio Olimpico (3pm ET, ESPN).What's happening: Unlike any of the previous 15 iterations, this year's tournament will be a pan-continental affair, with Rome acting as just one of 11 host cities.Stay on top of the latest market UEFA Euro 2024 Fußball-Europameisterschaft 2024 (in German) Tournament details Host country Germany Dates 14 June – 14 July (planned) Teams 24 Venue(s) 10 (in 10 host cities) ← 2020 2028 → The 2024 UEFA European Football Championship, commonly referred to as UEFA Euro 2024 or simply Euro 2024, will be the 17th edition of the UEFA European Championship, the quadrennial international men Sweden vs Georgia - 7.45pm kick-off, live on Sky Sports Football red button from 7.40pm Spain vs Greece - 7.45pm kick-off, live on Sky Sports Football red button from 7.40pm The 2020 UEFA European Football Championship, commonly referred to as UEFA Euro 2020 or simply Euro 2021 because revised schedule to played from 11 June – 11 July 2021. This is the 16th UEFA European Championship and it is the quadrennial international men's football championship of Europe organized by UEFA. Spain and Portugal made their bid to host the 2030 World Cup official on in Madrid, ahead of a Euro 2020 warm-up between the two nations. "We had the European Championship Ladies Final at the Friends Arena and received positive signals. This is surprising." The Euros usually take Sweden, meanwhile is hoping to make a big step toward qualification from the group stage by a win against their hosts today. The two teams Spain and Portugal made their bid to host the 2030 World Cup official on in Madrid, ahead of a Euro 2020 warm-up between the two nations. Three-time winners Spain will be looking to make a successful start to Euro 2020 as they bid for a record fourth European Championship.
The bidding process for the UEFA Euro 2020 is the process by which the location for the 16th European Championship, commonly referred to as Euro 2020, was selected.
Spain vs. Sweden Euro 2020 Betting Odds Spain vs Sweden – Spain will host Sweden at Estadio de La Cartuja for their EURO 2020 opener on Monday, June 14. UEFA Euro 2004, like 1992, produced an upset: Greece, who had only qualified for one World Cup and one European Championship before, beat hosts Portugal 1–0 in the final (after having also beaten them in the opening game) with a goal scored by Angelos Charisteas in the 57th minute to win a tournament that they had been given odds of 150–1 to win before it began (being the second least Euro 2020 host city's venues: Every stadium where the 2021 games are being held From Wembley to Baku, here's the full list of stadiums and host city venues where Euro 2020 matches will be held France managed the job perfectly well in 2016 but interest in hosting 2020 was a bit thin on the ground. The only bids for the finals came from Turkey, a joint effort from Ireland, Scotland and Paris (AFP) – Wales and the world's top-ranked team Belgium begin their Euro 2020 bids on Saturday after the delayed tournament finally kicked off with victory for an impressive Italy side on an emotional night in Rome.
PgJ
xqPh
AZbNB
rrvsR
England qualifiers euro 2020 watch online portugal vs. france
Fifa euro 2020 sweden vs. poland
Ireland euro 2020 qualifying fixtures dates scotland vs. czech republic
Apuramento euro 2020 portugal vs. germany
Watch euro 2020 qualifying live today netherlands vs. ukraine
The only bids for the finals came from Turkey, a joint effort from Ireland, Scotland and Paris (AFP) – Wales and the world's top-ranked team Belgium begin their Euro 2020 bids on Saturday after the delayed tournament finally kicked off with victory for an impressive Italy side on an emotional night in Rome. The UEFA Nations League is set to kick-off for the second time in history on Thursday to decide who will be the second winner after Portugal's win in 2019.
Euro 2020 hangi ülkede hungary vs. france
Where to watch fifa euro 2020 poland vs slovenia sweden vs. poland
Euro 2020 maçlar hangi kanalda portugal vs. germany
Eliminatoire euro 2020 netherlands vs. ukraine
What is the median estimate for the number of japanese yen per euro for calender year 2020 sweden vs
Euro 2020 qualifying tickets portugal scotland vs. czech republic

redpajama_set_name: RedPajamaCommonCrawl


Our reliable logistics provides same day delivery and make delivery of the products within the stipulated time frame. Apart from this, we have a perfect setup of personalized gift items and flower bouquets online to celebrate any occasion with your loved one. The offered cake can also be personalized with special messages and photographs. Additionally, to serve you with the best, we provide special services of free shipping on all the products which is an additional benefit point for all our customers. All you have to do is, visit us online and choose from a vast array.
So, set the music to rock the party and we are bringing a delectable cake for you.


The TAG produces a W3C Recommendation (using the usual W3C consensus process) addressing the technical background to the points listed above.
The TAG draws attention to the impact of legislation and contracts on the good operation of the web.
The TAG's work in this area proves valuable to and is endorsed by those who set policy and who make law.


Wow, thanks alot guys. I have a list of things to check out tonight/tomorrow and I really appreciate the advice and direction. Hopefully with some tlc, better gas I can get a cleaner looking file sent out.
Now you mentioned this Nolan, not to sound foolish but who is that and what does he do to the truck for $500 to tune it so well? I am very interested if I can keep the truck basically stock and get a huge performance increase. Anything my stock truck would need before doing this?
I appreciate all the help and the quick responses.
Sorry for come back but you still have the syclone? Still in Iowa? I'm in CB and own a Syclone #0644. Is yours #0643?


Takeover Lease on 2018 Infiniti Q50 3.0t Sport Sedan. 24 months left on contract. $694.00 p/month , total miles allowed on lease is 36,006 (1,150 miles p/month). This Infiniti lease is located in Brooklyn, NY 11213 - Shipping and Inspection Service are available upon request.


text:
Q: Parse error while installing application Am new to android studio.When I build and run the application everything seems to be fine.But am getting parse error while installing the app.
referred other posts,but didn't help
This is my build.gradle file
<apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion '20.0.0'
    defaultConfig {
        applicationId "com.xxxx"
        minSdkVersion 8
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}
dependencies {
    compile files('libs/google-play-services.jar')
    compile 'com.android.support:support-v4:23.0.1'
    compile files('libs/ksoap2-android-2.5.2.jar')
}

manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="xxxx" >

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-sdk android:maxSdkVersion="21" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
       >
        <meta-data
            android:name="com.google.android.gms.version"           />
        <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="@string/google_maps_key" />

        <activity
            android:name="Activity"
            android:label="activity_maps" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

A: It seems your first statement is corrupt. Remove the first character in your build.gradle script. Instead of
<apply plugin: 'com.android.application'

write
apply plugin: 'com.android.application'

redpajama_set_name: RedPajamaStackExchange


Old electrical fuse box Turn off light switches and unplug electrical devices in that area screw the new fuse into the threaded socket that held the old fuse. Turn on house power. The circuit should return to life. Close Whether youre in need of a replacement electrical fuse system for an old vehicle or youre needing to wire a vehicle there are aftermarket fuse panel kits that include multiple fuses relays and Dear barry the home im selling is very old and the main electric panel contains fuses rather than circuit breakers. The buyers home inspector says the electrical system is not up to current.
Old electrical fuse box So far we have replaced 30 electrical boxes that were old and in a bad condition with wires hanging out. These are wires meant to connect to the parks lighting and fuse boxes. We are concentrating And with it some of the electrical infrastructure. There are 13 working lights out of about 40 she said as well as old fuse boxes that cannot support operating certain types of equipment at the Faulty electrical components worth a few pence caused should be checked at least every five to 10 years. A fault in a fuse box is also thought to have started the devastating old town fire in.
Old electrical fuse box Better to light a single candle modern cars and trucks are heavily dependent on their electrical in the fuse box. Its simply a small pair of tweezers with jaws perfect for yanking fuses. Grab Several electricians have told me that a live breaker panel or fuse panel should only be opened by a q. In one of your electrical articles you said old two prong outlets should not be replaced Since we were revamping the electrical system we added a high output one wire alternator from summit at the same time. The 140 amp alternator feeds dual odyssey group 78 batteries that we mounted.
It's possible to get or download caterpillar-wiring diagram from several websites. If you take a close look at the diagram you will observe the circuit includes the battery, relay, temperature sensor, wire, and a control, normally the engine control module. With an extensive collection of electronic symbols and components, it's been used among the most completed, easy and useful wiring diagram drawing program. Old Electrical Fuse Box. The wiring diagram on the opposite hand is particularly beneficial to an outside electrician. Sometimes wiring diagram may also refer to the architectural wiring program. The simplest approach to read a home wiring diagram is to begin at the source, or the major power supply. Basically, the home wiring diagram is simply utilized to reveal the DIYer where the wires are.
In a parallel circuit, each unit is directly linked to the power supply, so each system gets the exact voltage. There are 3 basic sorts of standard light switches. The circuit needs to be checked with a volt tester whatsoever points. Old Electrical Fuse Box. Each circuit displays a distinctive voltage condition. You are able to easily step up the voltage to the necessary level utilizing an inexpensive buck-boost transformer and steer clear of such issues. The voltage is the sum of electrical power produced by the battery. Be sure that the new fuse isn't blown, and carries the very same amperage.
The control box may have over three terminals. After you have the correct size box and have fed the cable to it, you're almost prepared to permit the wiring begin. Then there's also a fuse box that's for the body controls that is situated under the dash. Old Electrical Fuse Box. You will find that every circuit has to have a load and every load has to have a power side and a ground side. Make certain that the transformer nameplate power is enough to supply the load that you're connecting.
Old electrical panel box home electrical fuse box fuse box to breaker box old time electrical fuse old electrical fuse box dangers cable fuse box murray fuse box old fuse box wiring disconnect.


When you need to call in a local pest control services provider, please don't be embarrassed. Pests are a fact of life.
At Pest Control Berkshire, sensitive to the dread that clients feel about vermin pest control, they wear unmarked uniforms and drive plain vehicles; they pride themselves on discretion.
Local pest controllers from leading firms have the most effective and pocket friendly solutions, health and safety knowledge, pest related expertise and experience. Rodent control is a key focus area for pest control specialists because the populations are increasing to staggering numbers. It is estimated that there are over 15 million rats in the UK and Berkshire, Hampshire and Wiltshire have their fair share to contend with.
Rodents are opportunists who appreciate access to a warm, safe home, food and water, rather like us.
The Brown Rat, Black Rat and the House Mouse are common problems in the UK.
House Mice, Mus Domesticus, are active throughout the year and are distinguishable by their large eyes and ears and small feet. They are 7-10cm in length plus a similar length tail and they can weigh anywhere from 12-30 grams. They particularly enjoy cereals and eat around 3 grams of food per day. They reach maturity by 12 weeks and have up to 8 litters per year of up to 16 babies.
The Brown Rat, Rattus Norvegicus, also called the Norway Rat, is a common pest but rest assured, it was the Black Rat, Rattus Rattus, which carried the plague. The Brown Rat is the only kind that lives in sewers.
Approximately 40cm in length, the tail is shorter than its sturdy body. This rat has a blunt nose and small ears. They will eat up to 30 grams of food, whatever they can gather, per day. Although they'll eat almost anything to survive, they won't obligingly dine on poison because the humans want them to. They'll scurry to their friends and tell them about a suspected hazard. Super-rats have evolved so that they are resistant to many over the counter treatments and eat them unaffected, even going back for second helpings.
They reach maturity by 12 weeks, have up to 6 litters per year of up to 8 young.
A local pest control operative knows that cunning and outwitting the intelligent vermin is essential to success; it can often be a progressive process rather than a one hit eradication.
Pest Control Berkshire's local pest control services are registered under the BASIS PROMPT scheme.
The RSPH/BPCA Level 2 Award or Level 2 Certificate in pest control or above.
The Royal Society of Health Pest Control Certificate.
The British Pest Control Association (BPCA) Diploma, Part I or II.


text:
Q: How do I only add complete items to this list I'm using an input field to accept comma-separated values then dynamically generating list items for each comma-separated value.  However, I don't want items added to the list until they have a comma after them.  For example, if I enter "Dog, Cat, Fish" in the input field, I don't want the following as I'm typing "Cat"

*

*Dog

*Ca

I want "Cat" to be added only once I've put a comma after it to indicate it is a complete entry.
Here's the code I'm using to achieve this.
      <input ng-list ng-model="labels" placeholder="Enter labels">

          {{ label }}

Link to running example
What's the angular way to achieve this?

A: One way to do this would be to use custom filters to filter the ng-repeat items instead of relying on the ng-list directive.
See the associated PLUNKER of the code below.
HTML
<input ng-model="labels" placeholder="Enter labels" />

          {{ label }}

JAVASCRIPT
filter('completeList', function() {
  return function(items) {
    var list = [];
    if(items) {
      list = items.split(',');
      var last = list[list.length - 1];
      if(items.charAt(items.length - 1) != ',' || last.length === 0)
        list.pop();
    }
    return list;
  };
});


Heidi Raykeil is the author of the books Love in the Time of Colic: The New Parents' Guide to Getting it on Again (Collins, 2009) and Confessions of a Naughty Mommy: How I Found My Lost Libido (Seal Press 2006). She is a contributor to Our Bodies, Ourselves: Pregnancy and Birth and to several anthologies, including Unbuttoned: Women Open Up About the Pleasures, Pains, and Politics of Breastfeeding (Harvard Common Press, 2009) and Literary Mama: Reading for the Maternally Inclined (Seal Press 2006). Her writing has also been featured in Parenting Magazine, Redbook, and online at iVillage.com. Heidi lives in Seattle with her husband and two daughters.


Jim is not going to be available to lead his usual ride tomorrow and asked me to cover for him. I will be at the Centennial Ice Rink at 08:30 with a sign in sheet. We will do the usual route to Bluffington's and back.


The recently opened Southern Precinct of Melbourne Airport Terminal 4 and Pier G developments commenced construction late 2013. The Airport was to remain fully operational during the construction process and thus all facets of construction were subject to a critical path analysis to deliver the project on time. A substantial amount of structural steel was included in the design of the various structures with over 2,700 tonnes of steel requiring 120 min fire protection with an intumescent coating system. The availability of a hybrid intumescent coating, Nullifire SC902, provided the solution to deliver the productivity outcomes required for this critical component of the project. By carrying out the intumescent coating application off-site (65,000kgs), the coated steel could be delivered to the construction site as finished sections ready for erection to meet the priorities of the construction program, minimising delays. Because bolted connections could be coated on-site at a later stage of construction the following trades could install services without disruption or delay.


From grad students to seniors, young children to young couples, a diverse crowd came out to U of T's Faculty Club on Nov. 4 for John Wall's talk on "A Quest for Co-Existence: People and Other Animals in an Increasingly Human World." Wall, who is director of the Jane Goodall Institute and a doctoral candidate in Carleton University's geography and environmental studies department, appeared as part of U of T's Centre for Environment seminar series.As dusk fell Wednesday evening, Wall asked his audience: what are the processes and prospects of living with endangered species? How do people adapt to living with animals, and vice versa?"[Dr. Goodall's] research has opened up a new view into animal behaviour, and chimpanzee behaviour and ecology," Wall said. "She doesn't see a sharp division between what we need to for other species and what we need to do for people. As she often puts it, 'Let's make a better world for the Earth and all of its inhabitants.'"A trip to Uganda as a volunteer development consultant shaped Wall's research interests. Not only did he become more aware of complicated conservation and economic development issues in the region, but he also began to wonder about how people and animals co-exist."The encounter" was the motif of Wall's talk. He pointed out that because not everyone can share the same experiences, each individual encounter is unique. Direct encounters as well as indirect and vicarious experiences can shape our position towards not only animals, but other social groups and communities as well."For me, an encounter with a chimpanzee, Sophie, changed my mind about people and animals. I was beginning to see myself in her eyes," Wall said. "Subsequently I thought, 'Humans are animals too, and just as our eyesight, hearing, smell, and touch are in continuum with other species, some of those species have capacities in those areas that far, far exceed our human capacity.'"Recently, Wall has focused on the mutual adaptations of people and threatened species. He has investigated eastern wolves in the Ottawa Valley, grizzly bears in Canmore, Alberta, and North Atlantic right whales in the Bay of Fundy.Wall said he hopes to continue working in human-animal studies that address conservation and development, and to examine how people develop their ideas of nature. "As we learn more about [encounters], and begin to see ourselves in the other," he said, "it completely transforms our relationship and our desire to live a peaceful and successful co-existence."


Susan, Thinking of you during this time.
Thank you for the memories aunt Jean! Thank you for all the lessons you taught me and the inspiration you gave me!
You have given us so many lovely memories: Neighbor, "Rent-a-mom", World traveling partner, and above all a wonder Friend. We are missing you already. The Powers family - Joan, Bill, Patty, Tom, Bob and "Rent a kid" - Mary Ann.
Cousin Jean always gave it to you straight; and always with thought, consideration, and most of all with heart and feeling. Living in Minnesota we never got to see enough of Jean, but when we did, it was always as if we had just been with her the day before. I'll miss that her chuckle...heh, heh. Love ya Jean!
My heart is heavy to learn that a special person in my life has passed. Jean was my sixth grade teacher in 1975 at Melridge Elementary School, and although she started out as my teacher, little did I know then that she would become much more to me over the decades that we have been friends. I had great joy in writing letters and cards to Jean to share with her the experiences and events throughout my life, as well as receiving the same from her. I consider myself very privileged and blessed to have had such a long and cherished friendship her. Jean was a most kind and very giving friend, an understanding mother figure and perhaps most of all she was an inspiring human being. I could always count on Jean for her wit, humor, laugh and practical outlook on anything. I greatly admired her curiosity to learn new things as well as her enthusiastic participation in numerous community activities that were dear to Jean's heart. My family and I will miss Jean greatly. Our heartfelt condolences to Jean's family, Susan, Tom, Lurissa, Jeroen, and Megan.


text:
TicketZen Partners With PayByPhone To Make Parking Ticket Payments Easier
Jonathan Shieber	@jshieber / 6 years
Terrible Labs, the maker of parking ticket payment app TicketZen, is partnering with PayByPhone's municipal parking payment service to bring its technology to the 9 million registered users on the PayByPhone platform.
TicketZen launched with the goal of making paying for tickets less of a pain, and now that the company is aligning itself with PayPoint's flagship PayByPhone product, the company can roll out in hundreds of new locations.
People can now pay for parking tickets using the umbrella of services they use to pay for parking.
"Partnering with PayByPhone allows TicketZen to scale its mobile parking ticket solution to PayByPhone's rapidly growing customer base," said Ryan Neu, TicketZen co-founder in a statement. "Both companies have adopted a mobile-first approach to simplify the parking experience."
In the US alone, parking ticket collection is a multi-billion dollar industry.
For 2012, the last year for which TicketZen had available data, Boston issued 1.5 million tickets and collected $62.2 million in revenue, Washington saw $92.6 million come into its coffers thanks to parking tickets, and New York added $567.6 million to its own municipal haul thanks to slips handed out by the NYPD. The city that never sleeps actually issues about 10 million tickets per year.
TicketZen's consumer app is not linked to specific municipalities, which means it can integrate with all of the disparate systems that comprise the fragmented ticket payment landscape for cities. The company says that 52% of its users have paid for more than one ticket, and that the bulk of its users are on iPhones rather than Android devices (to the tune of 85% of all payments).
What are the most common tickets that drivers are getting popped for? According to the app, it's meter fee expiration, parking in a restricted resident area, or street cleaning.
TicketZen isn't the only player in the parking ticket payment market. In 2010, Xerox (yes that Xerox), bought Affiliated Computers Services to get into the parking market — including ticketing. Los Angeles, San Francisco, Boston, and Washington are all customers and its technology powers the ticket payment websites for many of those cities.
In Cambridge, Mass. the two companies even went toe to toe over their payment systems.


text:
Who Wants To Be A Millionaire 2020 – LIVE updates as Donald Fear WINS
- Who are the past winners of Who Wants to Be a Millionaire?
- Who is Donald Fear?
- How to apply to be on Millionaire
- How old is Jeremy Clarkson?
- Who Wants to Be a Millionaire lifelines explained
Tanyel Mustafa
Kirsty McCormack
WHO Wants To Be A Millionaire? fans have been loving the latest season of the classic quiz show.
Host Jeremy Clarkson has been quizzing contestants all week, and tonight's final episode sees one brainy member of the public take home the incredible £1million prize.
Tonight's jackpot winner will be the sixth person in the history of the show to walk away with the £1million cheque.
Who Wants To Be A Millionaire? has been airing on ITV every night this week.
The show kicked off at 8.30pm tonight on ITV.
Follow our live blog below for the very latest updates
Tanyel Mustafa 11th Sep 2020, 22:01
A WORTHY WINNER
WOW. What a show.
Donald Fear took home the full £1,000,000 prize after scoring right on 15 questions. He only used one lifeline – 50/50 – and he raced through the questions effortlessly, making him the fastest winner the show has ever seen.
The 57-year-old and his family of five can sleep easy tonight, and the nation couldn't be happier for him.
Nice guys don't finish last. Thank you for reading!
IS THAT YOU SIR?
One of Donald's ex-students has given an amused seal of approval, saying: "As if my old history teacher from secondary school is about to smash a million."
Another old student of his, Jake Kelly @jakekellys, Tweeted: "My old history teacher, Mr. Fear. The one who inspired me to study history at university. A legend at school and, clearly, a legend now."
It's safe to say he's a deserving winner.
For Donald Fear it was quite literally in the name. He had nothing to fear when playing, despite his visibly watery eyes. Not only did he have the first win in 14 years, he did it in unbelievable record time.
Contestants have spent longer playing and not even come close to the winning question.
People wanted him to use his phone a friend lifeline just to gloat to his brother (who played and reached £500,000 – but Donald is too kind for that.
The latest winner of Who Wants To Be A Millionaire, Donald Fear, has said he won't quit teaching just yet.
The legend said he wants to see his A-Level students through before retiring. What a decent guy! Only after that will he whisk his wife away to sunnier climes around the world.
VIEWER SUPPORT
Many are thrilled for new millionaire Donald, taking to Twitter to express their congratulations. Some are even making a swipe at past winner Charles Ingram who was accused of cheating…
Fans of the show are amazed, saying how "incredible" Donald's performance was. Someone else said: "Love it when someone decent wins big."
In tough times it's nice to see the good guy win.
A NEW MILLIONAIRE
The million pound question was: "In 1718, which pirate died in battle off the coast of what is now North Carolina?"
The options were: A. Calico Jack, B. Blackbeard, C. Bartholomew Roberts, D. Captain Kidd. The answer was Blackbeard.
He only went and got it! Well done Donald! He said: "Every question fell for me". Luck was on Donald's side. He also says his brother will be pleased for him, and that he's now going to consider travelling round the world with his wife.
JEZZA IN AWE
Not only does Donald have three lifelines remaining, he's only got two questions left.
Jeremy asked how he retains so much information so effortlessly, and Donald replied: "As a history teacher obviously my job is to know stuff," it's as simple as that apparently.
Now playing for £500k – the amount his brother won – he's already smiling at the question before the options were revealed!
The question: "Who is the only British politician to have held all four 'Great Offices of State' at some point during their career?"
The options are A. David Lloyd George, B. Harold Wilson, C. James Callaghan, 7. John Major. Option C is the answer, which Donald got with ease.
He's now playing to be the seventh winner of Who Wants To Be A Millionaire.
Donald has just won £250k by answering: "Which of these cetaceans is classified as a 'toothed whale?". The answer was C. Sperm whale – something that Donald knew with the blink of an eye.
People over on Twitter are absolutely loving it. No rinsing for Jeremy with this one – he's just too smart.
"YOU NEED TO SLOW DOWN"
Jeremy has told Donald to "slow down", because he's answering questions that quickly. You'd feel confident knowing he was teaching your children, wouldn't you?
Maybe Donald will get his safari holiday after tonight's show.
"It's like sitting next to the internet in a pink shirt," gushed Jeremy. See, we appreciate the highlighter pink shirt.
SECURE FORTUNE
It's that time again – Donald is playing for the safety net of £32,000. So far he's used no lifelines.
He's also revealed his brother played the game once before, coming away with half a million. Maybe it runs in the family?
The question is: "Which of these religious observances lasts for the shortest period of time during the calendar year?"
Options: "A. Ramadan, B. Diwali, C. Lent, D. Hanukkah"
He's gone with 50/50 – it's the first time Donald has showed hesitation.
PEOPLE'S PREDICTIONS
Many on Twitter are predicting who will win tonight's episode. We know someone is going to win, but who is yet to be revealed.
Viewers are already making predictions about Donald. One viewer is so confident Donald will win that he's willing to give out fivers to those who like his Tweet if he's wrong. Maybe you can win your own small jackpot tonight if you go ahead and like?
STORMING AHEAD
Donald has gotten off to a cracking start – though that first question on what the 'H' in NHS stands for was pretty easy. It would be kind of embarrassing if he got that wrong as a teacher.
Someone has Tweeted: "My money is on the 70s porn star"… harsh. We appreciate the pink shirt, Donald.
Will Donald win the jackpot?
Hemal's Who Wants To Be A Millionaire journey is now over after taking a guess that didn't pay off. However, because he reached the safety net at £32,000, he hasn't lost any of the money he won.
Now it's time for History and Politics Teacher Donald Fear from Telford to take a stab at winning the jackpot.
Playing for £32,000 is a pivotal point. If won, contestants get a safety net which means winnings won't sink below that point.
The only thing is, if contestants lose they go back to £1,000.
With no lifelines left, Hemal took a bold risk and secured the safety net. He's going home at least £32,000 richer! Fortune favours the brave.
Thanks to Dave, Hemal still has a chance at getting his Storm Trooper outfit. It'll be that, or kitchen utensils if his wife has anything to say about it.
We're now at a break, so fill up your cup and get ready to see how much further Hemal can go with all of his lifelines gone.
KINDA UNHELPFUL
Hemal has now called his friend Scott.
"Which crustacean is situated on top of a telephone as part of a surrealist object created by Salvador Dali in 1936?"
A. Shrimp, B. Crab, C. Lobster, D. Prawn, are the options.
Bless Scott, he hadn't a clue. So now Hemal is getting on the phone to Dave using his last lifeline.
ALREADY TWO LIFELINES GONE
Now on question eight, Hemal now using his first and second lifeline! Going with 50/50 first, then ask the host!
Jeremy Clarkson, despite being slightly confused on why his expertise was being consulted on a question about women's perfume, got the question right.
Looks like Jezza is the one to consult on all your perfume needs.
NO AUDIENCE TO ASK
Due to the lack of an audience, contestants will get two phone a friend lifelines in place of losing the audience's help.
Hemal Shah is playing now with all lifelines available.
He says he'd buy a "storm trooper outfit" for a grand if he wins! Dream big…
Get comfy and grab a cuppa as the show is starting.
It's the first time a contestant has won the show in 14 years – so you won't want to miss this one.
And in record time too. I have a feeling we're all going to be impressed tonight.
AN EASY WIN?
Last night Laura Gallagher, a PhD Psychology student, was asked: "Which of these ITV daytime shows was first broadcast in 1988?"
She was given the options: A. Dickinson's Real Deal, B. GMTV, C. Loose Women, D. This Morning.
After using 50/50, she was left with GMTV and This Morning. Laura gambled on GMTV, saying the answer was now "easy" – only to find it was the wrong answer.
Just goes to show that being book smart doesn't mean you're pop-culture smart.
Kirsty McCormack 11th Sep 2020, 20:08
PHONE A FLING?
Elsewhere on the show this week, Jeremy Clarkson was left stunned when one contestant chose to Phone a Friend in the form of his own wife – and another man answered!
The 60-year-old host said: "That was another man just answered your phone. Relax, relax, it could be completely innocent."
Contestant JP Hogan was seen looking around the show's set, apparently confused by what was going on.
Viewers were intrigued, with one tweeting: "How awkward, phoning his wife for the phone a friend and a man answering… has an affair been exposed?"
Another howled: "Man uses his phone a friend, phones his wife and some dude answers 😂😂😂😂 awkward!!"
30 MINUTE COUNTDOWN
There's half an hour to go until tonight's episode kicks off!
So make sure you've got a cuppa, a pen and paper and your most intelligent pal on hand if you're planning to play along, just incase you need to phone a friend…
LLEWELYN-BOWEN BLUNDER
In February 2006, celebrity couple Laurence Llewelyn-Bowen and his wife Jackie appeared on the show to raise money for their chosen charity – The Shooting Star Children's Hospice.
The pair reached the final question of the quiz, and were asked: "Translated from the Latin, what is the motto of the United States?"
The Bowens answered with "In God We Trust", only to learn that the question's correct answer was "One Out of Many", which is the English translation for the Latin E pluribus unum.
However, the show later admitted that the question had been ambiguous and not fair to the pair.
Although E pluribus unum is considered the de facto motto of the United States, it was never legally declared as such; In God We Trust is the official motto of the country since 1956.
Following this revelation, the production company invited the Bowens back to tackle a new question, with their original winnings reinstated.
The couple chose not to risk the new question, and left with £500,000 for their charity.
Fans were delighted as host Jeremy Clarkson took to Twitter this evening ahead of tonight's show.
The father-of-three found himself trending on Thursday when cruel trolls started to spread rumours that he had died.
Social media users were delighted and relieved to see this wasn't the case as Jeremy tweeted about the show on Friday.
"You're ALIVE…Phew," one person replied, while another said: "Thank you for not being dead!"
JEREMY HAS SPOKEN!
The show's host Jeremy Clarkson has taken to Twitter to inform his 7.2 million followers that tonight's episode is a must see.
"Who Wants To Be A Millionaire is worth a watch this evening," the 60-year-old tweeted, and he was quickly inundated with replies.
"It's always worth a watch," one fan replied, while another added: "I'll be watching, really enjoyed the other shows this week."


text:
\section{Introduction}
\label{sec:intro}
From the point of view of thermodynamics, thermal states describe the equilibrium properties of a system.
Given a Hamiltonian $H$, the Gibbs state
\begin{equation}
  \rho_G = \frac{1}{\Z_G} e^{-\beta H} , \quad \Z_G = \tr e^{-\beta H}
  \label{eq:rho_gibbs}
\end{equation}
describes the state of the system at a given temperature $1/\beta$.
On the other hand, thermal states arise from the principle of maximum entropy~\cite{jaynes1957a,jaynes1957b}: for a given energy, the thermal ensemble is the one that maximizes the von Neumann entropy $S_G(\rho) = - \tr(\rho \log \rho)$.
Equivalently, this can be formulated as the minimization of the free energy
\begin{equation}
  F_{G}(\rho) = \tr(H \rho) - \frac{1}{\beta} S_G(\rho),
  \label{eq:free_energy_gibbs}
\end{equation}
so that
\begin{equation}
  \rho_G (\beta) = \arg \min_{\substack{\rho \succeq 0 \\ \tr \rho = 1}} F_{G}(\rho),
\end{equation}
for some fixed value of $\beta$.
To keep the notation light, we do not explicitly write the dependence of $\rho_G$ on this parameter.
One should keep in mind that the minimum is taken with respect to density operators, i.e.\ positive-semidefinite operators $\rho \succeq 0$ with a chosen normalization, typically $\tr(\rho) = 1$.
This optimization is not very convenient in practice, since the entropy $S_G$ is often difficult to compute, as it requires information about the entire spectrum of $\rho$.
In a quantum many-body setting, this would require diagonalizing an exponentially large operator, because of the inherent tensor product structure of the Hilbert space.

In the quantum many-body setting, numerical approaches to thermal equilibrium do not try to explicitly solve the optimization above, but resort to different approaches to approximate Eqs.~\eqref{eq:rho_gibbs}.
Monte Carlo methods use sampling to estimate very efficiently the physical properties from~Eqs.\eqref{eq:rho_gibbs}, but they encounter difficulties in scenarios where a sign problem appears, as can happen for fermionic models or frustrated systems.
A different approach is based on tensor networks (TNs), where the total state corresponds to the contraction of low-rank tensors and allows for a local description of the physics.
This is motivated by the fact that thermal states for a local Hamiltonian obey an area law for the mutual information~\cite{wolf2008,kuwahara2021}, and hence there is strong theoretical evidence that a tensor network description should be efficient at approximating thermal states~\cite{hastings2006,hastings2006a,molnar2015,guthjarkovsky2020,kuwahara2021}.

In practice, TNs are extremely successful for studying thermal equilibrium.
In one spatial dimension, matrix product states (MPSs) can be used to construct a representation of the (mixed) Gibbs state~\cite{verstraete2004,zwolak2004,feiguin2005,chen2017,chen2018} or, combined with sampling, to construct minimally-entangled thermal states~\cite{white2009,stoudenmire2010}.
Alternatively, the partition function can be represented as a two-dimensional TN, and its contraction can be approximated using tensor renormalization group approaches, for instance, as originally proposed in Refs.~\cite{nishino1995,bursill1996,wang1997}.
The algorithms can also be generalized for two-dimensional systems~\cite{czarnik2012,czarnik2014,kshetrimayum2019}.

In this paper, we study alternative thermodynamic ensembles that, instead of the von Neumann entropy, maximize the $\alpha$-Rényi entropy~\cite{renyi1961},
\begin{equation}
  S_\alpha(\rho) = \frac{1}{1-\alpha}\log{\tr \rho^\alpha}
  \label{eq:entropy_renyi}
\end{equation}
at a fixed energy.
In the limit $\alpha \to 1$, $S_{\alpha}$ reduces to the von Neumann entropy.
By replacing the von Neumann entropy in Eq.~\eqref{eq:free_energy_gibbs} by a Rényi entropy, we define the Rényi free energy:
\begin{equation}
  F_{_\alpha}(\rho) = \tr(H \rho) - \frac{1}{\beta_\alpha} S_\alpha (\rho).
  \label{eq:free_energy_renyi}
\end{equation}
We would like to stress that, in general, the extremizer $\rho_\alpha$ of this function is not the thermal ensemble.
However, as we will show in Sec.~\ref{sec:theory}, this ensemble nonetheless reproduces all local expectation values in the thermodynamic limit.
The parameter $\beta_\alpha$ is not, in general, related to the conventional inverse temperature $\beta$, but should be treated as a constant for the optimization.

From a TN perspective, the definition in Eq.~\eqref{eq:free_energy_renyi} offers the possibility of directly performing a minimization, since the Rényi entropies in Eq.~\eqref{eq:entropy_renyi} are efficiently computable---at least for small integer values of $\alpha$.
In this paper, we analyze the properties of such ensembles, in particular, how they approximate the thermal properties, and present several variational algorithms which can be used to compute them.

For practical purposes, we will often consider the most convenient case $\alpha = 2$, for which Eq.~\eqref{eq:free_energy_renyi} becomes
\begin{equation}
  \rho_R := \arg\min_{\rho \succeq 0 } F_{R}, \quad
  F_{R}(\rho) =  \tr(H \rho) + \frac{1}{\beta_R}\log \tr\rho^2,
  \label{eq:objectivefun}
\end{equation}
where the subscript $R$ represents $\alpha = 2$.
In other words, optimizing Eq.~\eqref{eq:objectivefun} is equivalent to finding the most mixed state at a chosen energy.
In applied mathematics, the optimization of such a function is known as a non-linear semi-definite programming and can be tackled with interior-point methods.
However, in many-body quantum physics, the dimension of $\rho$ increases exponentially with the system size, making such approaches impractical for large systems.

This paper is organized as follows.
In Sec.~\ref{sec:theory}, we provide an analytical solution to Eqs.~\eqref{eq:objectivefun}, expressed in the eigenbasis of the Hamiltonian.
Since the eigenbasis of a many-body system is not always accessible, we propose an optimization strategy based on uniform MPSs, to approximate the purification of $\rho_R$ directly in the thermodynamic limit.
This non-linear optimization can be accelerated using state-of-the-art techniques~\cite{hauru2021} by restricting it to the Grassmann manifold.
This is discussed in detail in Sec.~\ref{sec:optimization}, and accompanying numerical experiments to benchmark the algorithm are presented.
Moreover, we present an alternative technique, based on a non-linear evolution of the density operator in Sec.~\ref{sec:evolution}, which flows toward the desired ensemble.
To conclude, we discuss possible developments in Sec.~\ref{sec:conclusion}.

\section{Theoretical framework}
\label{sec:theory}

\subsection{Maximal Rényi ensemble}
We now show the analytical form of the extremizer of Eq.~\eqref{eq:free_energy_renyi}, which has been previously derived for classical distributions~\cite{bashkirov2004,brody2007,bunte2014}.
We can use this result in the quantum case, noticing that the state that minimizes Eq.~\eqref{eq:free_energy_renyi} must be diagonal in the energy eigenbasis $\{\ket{E_k}\}$ and thus its eigenvalues are equivalent to a probability distribution.

To find the coefficients $\{p_k\}$ in the density operator $\rho = \sum_k p_k \ket{E_k}\bra{E_k}$, $\rho \succeq 0$ which maximizes the Rényi entropy Eq.~\eqref{eq:entropy_renyi} under the constraints
$\tr\rho = 1$ and $\tr(H \rho) = \bar{E}$, we introduce the Lagrange multipliers $\beta_\alpha$ and $\gamma_\alpha$.
The functional $\lagrangian$ is then
\begin{multline}
  \lagrangian(\rho) = \frac{1}{1-\alpha}\log{\sum_k p_k^\alpha} \\-\gamma_\alpha \left(\sum_k p_k - 1\right) - \beta_\alpha \left(\sum_k E_k p_k - \bar{E}\right).
\end{multline}
At the stationary point, the parameter $\gamma_\alpha$ can be eliminated~\cite{bashkirov2004}, and we obtain the \emph{maximal Rényi ensemble} (MRE)
\begin{equation}
  \rho_\alpha = \frac{1}{\Z_\alpha} \Pi_{E_\perp} \left(1 - \beta_\alpha\frac{\alpha - 1}{\alpha}(H - \bar{E}) \right)^{\frac{1}{\alpha - 1}}\Pi_{E_\perp},
  \label{eq:mre}
\end{equation}
where $\Z_\alpha$ is a normalization factor and $\Pi_{E_\perp}$ is a projector onto the eigenvalues below a cutoff energy $E_\perp := \frac{\alpha}{\beta(\alpha - 1)} + \bar{E}$~\footnote{
  Symmetrically, there is also a solution with a projector onto energies above the cutoff energy: $E > E_\perp$.
  For simplicity, we ignore this solution, as it is the Rényi equivalent of negative temperatures.
}:
\begin{align}
  \Pi_{E_\perp} &= \Theta(E_\perp - H), \nonumber \\
  \Z_\alpha &= \tr\left[{\Pi_{E_\perp} \left(1 - \beta_\alpha\frac{\alpha - 1}{\alpha}(H - \bar{E}) \right)^{\frac{1}{\alpha - 1}}}\right],
\end{align}
where $\Theta(\cdot)$ is the Heaviside function.

\begin{figure}[htbp]
  \includegraphics[width=\columnwidth]{demo_combined.pdf}
  \includegraphics[width=\columnwidth]{demo_entropies.pdf}
  \caption{
    (a) Distribution $p(E)$ of the maximal Rényi and Gibbs ensembles for different values of $\alpha$ for the Ising model in Eq.~\eqref{eq:ising}, with longitudinal and transverse fields, respectively, $h_x = 0.5$ and $h_z=-1.05$ and system size $N=10$ (PBC). The mean energy $\bar{E}$ is fixed at $-1/4$ of the width of the spectrum. (b) The same distributions weighted with the corresponding density of states $D(E)$, from the approximation in Ref.~\protect{\cite{atas2014}}.
    Below, the von Neumann (c) and 2-Rényi (d) entropies for the canonical (solid line) and 2-Rényi (dashed line) ensembles are compared at a given mean energy density, for the same system size and Hamiltonian.
    In both cases, the asymptotic behaviors $\lim_{\beta \to 0} S_G = \lim_{\beta_R \to 0} S_R = N \log 2$ and $\lim_{\beta \to \pm\infty} S_G = \lim_{\beta_R \to \pm\infty} S_R = 0$ are recovered.
    The branch with negative (positive) mean energy density corresponds to a $\beta > 0$ ($\beta < 0$), corresponding to a solution with a projector onto energies below (above) the cutoff energy $E_\perp$.
  }
  \label{fig:demo}
\end{figure}

To illustrate the behavior of Eq.~\ref{eq:mre}, we show in Fig.~\ref{fig:demo} some characteristics of the different ensembles in a particular finite case.
In Figs.~\ref{fig:demo}(a) and \ref{fig:demo}(b), we show the distribution of $\rho$ relative to the eigenbasis.
The MRE has a distinctive cutoff energy, beyond which the distribution is zero and therefore fairly different from the case of the canonical ensemble.
However, in a many-body system, we have to consider that the density of states is not uniform but becomes increasingly peaked in the middle of the spectrum.
Then the distributions, weighted by the density of states, become much more similar, as seen in Fig.~\ref{fig:demo}(b).

Another way of visualizing the relation between the canonical and the Rényi ensembles is to compare their entropies for the same mean energy $\bar{E}$.
In Figs.~\ref{fig:demo}(a) and \ref{fig:demo}(b), we explicitly show the comparison of von Neumann and 2-Rényi entropies for the ensembles that maximize each of them over the whole energy range for a small system size. While the behavior is qualitatively similar, both ensembles only coincide in the limiting cases $\bar{E}=0$, when the state is maximally mixed (corresponding to the Gibbs ensemble at infinite temperature $\beta=0$) and $\bar{E}=E_{\min}$ ($E_{\max}$), when the ensemble reduces to the ground (maximally excited) state, corresponding to $\beta \to +\infty$ ($-\infty$).

\begin{figure}[htbp]
  \includegraphics[width=\columnwidth]{classical.pdf}
  \caption{
    (a), (b) Von Neumann and 2-Rényi entropies of $\rho_R$ as a function of mean energy density, for the (classical) Ising model with $h_x = 1/2$, $h_z = 0$.
    Since there is no visible difference in the curves for $\rho_G$, only the largest size ($N=500$) is shown.
    Oscillations at finite size are due to the fact that the eigenvalues correspond to only a number of discrete energies.
    The von Neumann entropy density of the Rényi ensemble approaches that of the Gibbs ensemble, as the system size increases.
    The two ensembles, however, exhibit a difference at intermediate values of the energy density when comparing their 2-Rényi entropy.
    (c) Comparison of $\beta$ and $\beta_R$ as a function of the mean energy density for the largest size.
    The correspondence is discussed further in Sec.~\ref{sec:descent}.
  }
  \label{fig:classical}
\end{figure}
To study the behavior at large system sizes, we chose to study an exactly solvable case, the results of which are in Fig.~\ref{fig:classical}.
For this Hamiltonian, the density of states becomes Gaussian and the arguments in Appendix~\ref{sec:variance} hold.
While we expect that local observables for both ensembles coincide as the system size increases, the same does not need to hold for non-local quantities, such as the entropies.
It is interesting to notice that the Rényi ensemble has a von Neumann entropy which approaches the Gibbs state, and hence will have a free energy---see Eq.~\eqref{eq:free_energy_gibbs}---which increasingly approaches its maximal value.
However, the same cannot be said for the Rényi free energy introduced in Eq.~\eqref{eq:free_energy_renyi}.

\subsection{Equivalence of local observables}
We now consider a one-dimensional quantum system described by a local Hamiltonian $H$, an operator in the complex Hilbert space $\hilb$.
This total Hilbert space is formed by the tensor product of $N$ local Hilbert spaces:
\begin{equation}
  \hilb = \bigotimes_{n=1}^N \hilb_n.
\end{equation}
The Hamiltonian is restricted to be $\ell$ local, i.e.\ it can then be written in the form
\begin{equation}
  H = \sum_{n=1}^N  h_n,
  \label{eq:hamiltonian}
\end{equation}
where each $h_n$ acts non-trivially only on sites $n,\dots,n+\ell-1$, and has finite operator norm.
Additionally, we will assume that almost all local terms satisfy $\|h_n\|_{\text{op}} > 0$, such that the spectrum of $H$ is extensive.
We mostly consider infinitely large systems, but, when considering finite systems, we specify either open boundary conditions (OBC) or periodic boundary conditions (PBC).

In this setting, it is straightforward to see that the \emph{density of states}
\begin{equation}
  \dos(E) =  \delta (H - E)
  \label{eq:dos}
\end{equation}
has a variance which scales as $\order(\sqrt{N})$.
For specific models, such as strictly one-local Hamiltonians, it can be shown that $D(E)$ becomes Gaussian in the thermodynamic limit.
Under the assumption of a Gaussian density of states, we can then compute the variance of the energy when we take into account the energy distribution of the ensemble.
In the case of the 2-Rényi entropy, it turns out that this can be computed exactly.
As described in Appendix~\ref{sec:variance}, in both cases the variances $\var{H}_G$ and $\var{H}_R$ scale as $\order(N)$.
Hence, if we think about the normalized energy spectrum, both distributions will be increasingly peaked around the same $\bar{E} = \braket{H}$ with a standard deviation $\order(1/\sqrt{N})$ for large $N$.
Hence, the expectation values of local observables become equivalent in the thermodynamic limit.
This derives from the correspondence between microcanonical and canonical ensembles~\cite{landau1991}.
While there exist counterexamples to this correspondence, a sufficient condition for it to hold is that the energy per site converges to a constant~\cite{touchette2003,ellis2004}.
Note that while this argument has been carried out for a Gaussian density of states, we believe that it can be extended to the general case as long as the Hamiltonian is local.

As a final note, we wish to remark that, at least in the case of $\alpha = 2$, we find a correspondence $\beta_R \to \beta$ which holds in the thermodynamic limit.
This holds asymptotically for large $\beta_R$ and the range of validity of this approximation increases with system size.
Hence, the $\beta_R$ for which the Rényi ensemble has the same energy density $\bar{E}$ as a Gibbs ensemble turns out to be the same as the inverse temperature $\beta$.
This can be shown in the case of a Gaussian density of states (see Appendix~\ref{sec:variance}), and is observed numerically in both integrable and non-integrable models (see Sec.~\ref{sec:optimization}).
This is somewhat surprising, since \emph{a priori} there is no connection between the parameters describing the two different ensembles.
From a practical point of view, however, this correspondence is convenient to approximate a thermal ensemble, since we may as well take $\beta_R$ to be the inverse temperature.

\section{Variational algorithms for approximating the Rényi ensemble}
In this section, we introduce two different possibilities to numerically obtain the Rényi ensemble in Eq.~\eqref{eq:mre}.
Although we have a closed form for the exact solution, its use in a many-body setting is impractical because it would require knowledge of the full energy eigenbasis or of the projector in Eq.~\eqref{eq:mre}.
This motivates the formulation of methods compatible with TN techniques.
In Sec.~\ref{sec:optimization}, we explore how uniform MPSs can be used to form a purification which represents the density matrix, and its individual tensors can be optimized directly by using techniques from Riemannian optimization.
In Sec.~\ref{sec:evolution}, instead, we propose a non-linear evolution which has Eq.~\eqref{eq:mre} as a fixed point, so any arbitrary state can be brought to the desired one by simulating this evolution for a sufficient amount of time.

\subsection{Minimization on the MPS manifold}
\label{sec:optimization}
The optimization problem in Eqs.~\eqref{eq:objectivefun} can be restricted to the manifold of states described by some class of tensor networks.
In particular matrix product states (MPS) are arguably the most effective ansatz to represent ground states of local, gapped Hamiltonians in one dimension~\cite{verstraete2006,hastings2006,hastings2007,huang2015}.
We consider a uniform MPS, which written in the conventional diagrammatic notation, is
\begin{multline}
  \ket{\Psi(A)} = \includetikz{mps} \\
  = \sum_{\vec{s}} \tr \left( \dots A^{s_{n-1}} A^{s_{n}} A^{s_{n+1}} \dots \right) \ket{\vec{s}} .
  \label{eq:mps}
\end{multline}
Hence, given a local basis $\{\vec{s}\} = \{s_1, \dots, s_N\}_{s=1,\dots,d}$, each $A$ is a rank-3 tensor with a physical index of dimension $d$ and two virtual indices contracted with the neighboring tensors, each with dimension $D$~\cite{verstraete2008,schollwock2011,orus2014}.
In this section, we focus on uniform MPS for simplicity, but the method can be applied to finite MPSs as well.

A natural generalization of MPS for quantum-mechanical operators is a matrix product operator (MPO)~\cite{verstraete2004,zwolak2004,pirvu2010}, which is composed of rank-4 tensors contracted sequentially,
\begin{equation}
  O = \includetikz{mpo}.
\end{equation}
The issue with this construction is that it is hard to ensure positivity (if the tensors are over the field $\mathbb{C}$ or $\mathbb{R}$), which is a necessary and physical property for objects like density operators.
The problem is that positivity is a global property, which cannot be captured in the local tensors~\cite{delascuevas2013,kliesch2014,delascuevas2016}.
Although an MPO ansatz has been used successfully to approximate the stationary points of dissipative dynamics~\cite{cui2015,mascarenhas2015}, it is problematic for a variational method since there is no way to vary the local tensors without compromising positivity.

An alternative is to introduce a \emph{locally purified state}~\cite{verstraete2004,delascuevas2013,werner2016}, which guarantees the positivity of the operator for any local tensor.
The construction goes as follows.
One considers a pure state, where each site has twice the degrees of freedom, which we call \emph{system} and \emph{ancilla}, so the local tensor is
\begin{equation}
  A = \includetikz{purification-tensor}.
\end{equation}
By tracing out the ancillary degrees of freedom, we obtain a ladder-like TN, which represents the density matrix $\rho = \tr_{\mathrm{anc}} \ket{\Psi}\bra{\Psi}$, or, graphically:
\begin{equation}
  \rho = \includetikz{construction}.
\end{equation}
Shaded boxes represent complex conjugation.
It is simple to see that this TN is positive semidefinite by construction.
The price to pay is that we have introduced a non-linearity in $\rho$ with respect to the local tensors $A^{s}$, so even if the objective function is quadratic in $\rho$, as in Eqs.~\eqref{eq:objectivefun}, it will be quartic in the local tensors.
Hence we cannot use linear algebra to iteratively optimize the local tensors, as in the case of the density matrix renormalization group (DMRG)~\cite{schollwock2011}.
Nonetheless, we can consider the problem in Eq.~\eqref{eq:objectivefun} a non-linear optimization over the tensors of an MPS.

The parametrization of the state in Eq.~\eqref{eq:mps} has an inherent redundancy, since we can perform a gauge transformation on the virtual degrees of freedom of the form $A^s \mapsto X A^s X^{-1}$, for any invertible matrix $X$.
This gauge redundancy of the MPS parametrization allows us to choose the tensors to fulfill the left-gauge condition:
\begin{equation}
  \includetikz{fixedpoint-left}, \quad \includetikz{fixedpoint-right}.
  \label{eq:fixedpoints}
\end{equation}
For the rest of this paper, we will often not draw the ancillary degree of freedom, but implicitly assume it is part of the physical leg of each tensor.
The tensor $\varrho$ is the (positive-semidefinite) right fixed point of the transfer matrix, which encodes the Schmidt values~\cite{schollwock2011}.
Hence, we can view the tensor $A$ as a linear map from the right virtual leg to the left virtual and
physical legs, which is \emph{isometric}.
We will use $W$: $\mathbb{C}^D \mapsto \mathbb{C}^d \times \mathbb{C}^D$ to denote this specific mapping.
Alternatively, we can think of $W$ as a matrix, so we can use the notation $W^\dag W = \mathbbm{1}$ to unambiguously specify the isometricity condition.

Hence we can restrict a generic optimization of an MPS to the optimization of tensors over the Stiefel manifold~\cite{absil2008},
\begin{equation}
  \stiefel(n,p) = \left\{W \in \mathbb{C}^{n \times p} | W^\dag W = \mathbbm{1} \right\}.
\end{equation}
In reality, since there is a unitary freedom remaining in Eq.~\eqref{eq:fixedpoints}---namely, $A^s \mapsto U^\dag A^s U$---one can restrict the manifold even further to the Grassmann manifold.
The Grassmann manifold should be understood as a quotient manifold, namely all $W$ satisfying the isometricity condition up to a basis rotation, and it is often denoted as $\grassmann(n,p) = \stiefel(n,p)/\mathrm{U}(p)$~\cite{absil2008}.

To optimize a generic function $f(A)$: $\grassmann(Dd,D) \to \mathbb{R}$ using any gradient-based optimization, we must be able to compute the gradient with respect to the parameters in $A$ and project it onto the tangent space of the Grassmann manifold.
The optimization of differentiable functions on Riemannian manifolds has been the object of extensive studies in mathematics and recently these techniques have been applied to TNs~\cite{hauru2021}.
For the self-containedness of this paper, we summarize the key ingredients of this optimization in Appendix~\ref{sec:tech}.

\begin{figure*}[thbp]
  \includegraphics{integrable_parametric.pdf}
  \caption{
    Magnetization (a) and next-neighbor correlation $\Gamma^{z,z}$ (b) versus the mean energy density for the Ising model with $h_x = 0$, $h_z = 3/2$, for different bond dimensions $D$.
    The dotted line corresponds to the exact results with the same mean energy density.
    In (c) and (d), the absolute errors to the exact solution are compared.
    No spontaneous symmetry breaking can occur at finite temperature in one-dimensional systems with local interactions---we therefore explicitly enforce the $\mathbb{Z}_2$ symmetry in the tensors.
  }
  \label{fig:integrable}
\end{figure*}
\begin{figure}[htpb]
  \includegraphics{integrable_beta.pdf}
  \caption{Average energy from Fig.~\ref{fig:integrable} choosing $\beta_R = \beta$.}
  \label{fig:integrable_beta}
\end{figure}
\begin{figure*}[htpb]
  \includegraphics{nonintegrable_parametric.pdf}
  \caption{
    (a)--(d) Different observables as a function of the mean energy density for the nonintegrable case with $h_x = 0.5$, $h_z = -1.05$.
    The dotted line corresponds to the results given by the iTEBD algorithm.
  }
  \label{fig:nonintegrable}
\end{figure*}

For our application, the objective function is given by Eqs.~\eqref{eq:objectivefun}.
For the uniform MPS of Eq.~\eqref{eq:mps}, it reduces to
\begin{equation}
  f_R := \frac{F_R}{N} = \varepsilon + \frac{1}{\beta_R} \log \eta,
  \label{eq:objectivefun_mps}
\end{equation}
where $\varepsilon = \tr(H \rho)/N$ is the energy per site and $\eta = \left(\tr\rho^2\right)^{1/N}$ is the purity per site.
Both these terms are computable with standard TN routines in polynomial time, for uniform MPSs as well as finite MPSs.
The gradient of Eq.~\ref{eq:objectivefun_mps} with respect to $A$ is
\begin{equation}
  \frac{\partial f_R}{\partial A} = \frac{\partial \varepsilon}{\partial A} + \frac{1}{\beta_R \eta} \frac{\partial \eta}{\partial A}.
  \label{eq:gradient}
\end{equation}
As for Eq.~\eqref{eq:energy}, both these quantities $\partial \varepsilon/\partial A$ and $\partial \eta/\partial A$ are simple to obtain, as described in Appendix~\ref{sec:gradient}.
We thus use this gradient information to perform the optimization on the Riemannian manifold using the l-BFGS algorithm~\cite{liu1989,nocedal1999}.
An open-source implementation of the non-linear optimization in \textsc{Julia} is available online~\footnote{\url{https://github.com/giacomogiudice/RenyiOptimization.jl}}.

To conclude, we note that gradient methods cannot guarantee in any way convergence toward the global minimum, but only some local minimum.
While Eqs.~\eqref{eq:objectivefun} have a unique solution in the cone of the positive operators, the same cannot be said on a uniform MPS manifold of fixed bond dimension.

\subsubsection{Numerical experiments}
\label{sec:descent}
For our numerical experiments, we consider the Ising model:
\begin{equation}
  H = -\sum_k \left(\sigma^x_k \sigma^x_{k+1} + h_z \sigma^z_k + h_x \sigma^x_k \right).
  \label{eq:ising}
\end{equation}
When the parallel field vanishes ($h_x = 0$), the model is integrable, and local observables and correlations have a closed form~\cite{katsura1962,niemeijer1967}.
We use this model to perform the optimization of Eqs.~\eqref{eq:objectivefun} as described in Sec.~\ref{sec:optimization}.
The parameter $\beta_R$ is fixed to different values in the interval $\beta_R \in [0,2]$, and the uniform MPS is optimized until the gradient is sufficiently small~\footnote{The optimization halts after the norm of the gradient vector in tangent space is smaller than $10^{-6}$.}.

The results of the optimization are shown in Fig.~\ref{fig:integrable}, where we plot some local observables such as the magnetization $\braket{\sigma^z_i}$ and next-neighbor correlation $\Gamma^{a,b} = \braket{\sigma^a_{i} \sigma^b_{i+1}} - \braket{\sigma^a_{i}}\braket{\sigma^b_{i+1}}$ as a function of the mean energy density of the ensemble.
By increasing the bond dimension, we increase the number of the free parameters, and the numerical results converge toward the thermal ones.
Additionally, the comparison of the thermal observables by setting $\beta_R = \beta$ is shown in Fig.~\ref{fig:integrable_beta}.
Up to $\beta_R \lesssim 2$, we observe that there is a correspondence between the two ensembles at $\beta_R = \beta$.
For $\beta_R \gtrsim 2$, the optimization of Eq.~\eqref{eq:objectivefun_mps} converges to the ground space exactly, especially at small bond dimensions.
To study the physics of low temperatures, it is therefore more convenient to reexpress the optimization problem in Eqs.~\eqref{eq:objectivefun} by introducing a Lagrange multiplier:
\begin{equation}
  \rho^\ast = \arg \min_{\rho \succeq 0} \left\{\tr \rho^2 + \frac{\lambda^2}{2} \left( \tr(H \rho) - \bar{E} \right)^2\right\}.
\end{equation}
The gradient (see Appendix~\ref{sec:gradient}) can be modified accordingly, and the non-linear optimization can be performed in a similar way.
This objective function gets rid of the dependence on $\beta_R$, and one can directly choose an energy to target, since $\lim_{\lambda \to \infty}\tr(H\rho^\ast) = \bar{E}$.
However, if one wishes to explore the behavior of some observable with respect to $\bar{E}$, it is not necessary to perform the extrapolation with $\lambda \to \infty$, but a finite $\lambda$ is sufficient to obtain an energy in the vicinity of the desired value~\footnote{
  In our simulations, we set $\lambda = 10$.
  Since the purity per site $0.5 \leq \eta \leq 1$ is order 1, we expect deviations in energy density around $\order(1/\lambda^2)$.
}.

We also wish to remark that the method is completely general and does not depend on whether the system is integrable or not.
To complete our benchmarks, we present in Fig.~\ref{fig:nonintegrable} a comparison in the case where a parallel field is introduced, making the system non-integrable.
In this case, exact results are not known, but our results are compared to those of an MPS approximation to the Gibbs state purification obtained with a traditional imaginary time evolution method~\cite{vidal2003,verstraete2004}.
Since the model does not have a finite-temperature phase transition, the method will behave similarly for any value of the fields.
If one chooses $h_x=0$ and $h_z=1$, we expect that the required bond dimension increases when $\beta\to\infty$, as the critical ground state is approached~\cite{tagliacozzo2008,pollmann2009,pirvu2012,lauchli2013}.
In this regime, the cost function in Eq.~\eqref{eq:objectivefun} will be dominated by the energy term.
Hence the algorithm is reduced to an energy minimization, and we expect it to behave equivalently to other variational methods, such as the one proposed in Ref.~\cite{hauru2021}.

\subsection{Non-linear evolution}
\label{sec:evolution}
\begin{figure}[htb!]
  \includegraphics[width=0.8\columnwidth]{evolution.pdf}
  \caption{
    2-Rényi entropy of the maximal Rényi ensemble obtained with the analytic solution (solid lines) and nonlinear evolution (points).
    Results are for the Ising model (OBC) in Eq.~\eqref{eq:ising} with longitudinal and transverse fields, respectively, $h_x = 0.5$ and $h_z =-1.05$.
    We also show numerical results for $N=20$ (triangles) obtained using the non-linear evolution with MPS.
  }
  \label{fig:evolution}
\end{figure}
In Ref.~\cite{shi2020}, the authors introduced a non-linear evolution for approximating the thermal ensemble with Gaussian states.
Here we generalize this idea for the Rényi entropies, which gives rise to an evolution that is efficiently computable with TN techniques.
We consider a non-linear evolution of a density operator $\rho_\tau$ which depends on a real parameter $\tau$
\begin{equation}
  \dot{\rho}_\tau := \frac{\partial \rho_\tau}{\partial \tau} = - \frac{1}{2} \left\{\J_\tau - \braket{\J_\tau}, \rho_\tau\right\} .
  \label{eq:evolution}
\end{equation}
The operator $\J_\tau$ can be chosen such that the fixed point of this evolution gives rise to the MRE.
For example, the choice
\begin{equation}
  \J_\tau \rho_\tau = \beta_R H + \frac{2}{\tr \rho_\tau^2} \rho_\tau
  \label{eq:evolution_operator}
\end{equation}
gives rise to the same density operator as Eq.~\eqref{eq:objectivefun}.
The proof follows similarly from Ref.~\cite{shi2020}, and it is sufficient to show that the operator $\J_\tau$ in Eq.~\eqref{eq:evolution_operator} satisfies the following criteria:
\begin{subequations}
  \begin{align}
    &\tr{\rho}_\tau = 1, \; \forall \tau \in \mathbb{R} &\quad &\text{trace conservation,}
    \label{eq:evolution_criteria_trace}\\
    &\rho_\tau \succeq 0, \; \forall \tau \in \mathbb{R} &\quad &\text{positivity conservation,}
    \label{eq:evolution_criteria_positivity}\\
    &\partial f_R(\rho_\tau)/\partial \tau \leq 0 &\quad &\text{free-energy decrease.}
    \label{eq:evolution_criteria_decrease}
  \end{align}
  \label{eq:evolution_criteria}
\end{subequations}
Hence, choosing an appropriate density operator $\rho_0$ and integrating Eq.~\eqref{eq:evolution} over a sufficiently long interval, we obtain the solution to Eqs.~\eqref{eq:objectivefun}, since its value can only decrease with time.
There is no guarantee of reaching the global minimum---and indeed any eigenstate of $H$ does not evolve under Eq.~\eqref{eq:evolution}---but a random choice of the initial state should be sufficient in most cases.

We present some numerical experiments on small system sizes in Fig.~\ref{fig:evolution}, where the energy eigenbasis is available.
In all cases, the numerically integrated density operator converges to the ensemble in Eq.~\eqref{eq:mre}.
The evolution is discretized by expanding Eq.~\eqref{eq:evolution} to first order:
\begin{equation}
  \rho_{\tau + \delta \tau} \approx e^{-\frac{\delta \tau}{2} (\J_\tau - \braket{\J_\tau})} \rho_\tau e^{-\frac{\delta \tau}{2} (\J_\tau - \braket{\J_\tau})}.
  \label{eq:evolution_discretized}
\end{equation}
If the time step is chosen to be sufficiently small, then this evolution will converge to the desired fixed point.
This is witnessed by the fact that the Rényi entropy reaches the theoretical maximum for each mean energy, as shown in Fig.~\ref{fig:evolution}.
As a proof of concept, we also perform the integration using MPSs, in particular, using the TDVP scheme~\cite{haegeman2016,vanderstraeten2019} to update the state at each time step.
In practice, however, we observe that the time step required to obtain accurate results scales unfavourably with the system size, and we have yet to fully understand if the evolution becomes ill-conditioned for large system sizes.
Notwithstanding, it is possible that different integration schemes allow for large time steps without compromising the stability of the evolution.
We leave this as a venue for future work.

\section{Outlook}
\label{sec:conclusion}
In this paper, we have introduced an approach to compute thermal expectation values.
Instead of attempting to approximate the minimum of the free energy, we construct an ensemble that maximizes the 2-Rényi entropy for the same mean energy, and---in the thermodynamic limit---reproduces local observables of the corresponding Gibbs ensemble.

We have shown that this ensemble can be efficiently approximated using TNs and have presented variational algorithms to obtain such an approximation.
It is possible to work directly in the thermodynamic limit and use an MPS representation of the ensemble, which optimizes the objective function in Eqs.~\eqref{eq:objectivefun}.
Despite the simple form of this function, the optimization is non-linear and must be tackled with gradient-based methods.
The fundamental reason is that the positivity constraint in TNs is highly non-local, and one way of enforcing it is via a purification.
The convergence can be accelerated with techniques from manifold optimization, but a fundamental limitation is the high contraction cost.
Indeed, for a purification of bond dimension $D$, the time complexity involved in computing the purity (see Appendix~\ref{sec:gradient}) is $\order(D^5)$, which is significantly higher than the typical $\order(D^3)$ for other popular MPS algorithms, such as time evolution or ground-state search.
Coincidentally, the former is the same leading cost of the original formulation of DMRG with PBCs~\cite{verstraete2004a}.
Although the time complexity is higher, we observe that a moderate bond dimension captures well the ensemble and its local properties, both in integrable and nonintegrable models.

As an alternative to gradient-based optimization, we also propose an alternative method based on a non-linear evolution of the density operator.
Under this evolution, the objective function in Eqs.~\eqref{eq:objectivefun} is monotonically decreasing, and hence flows to the MRE.

Despite these limitations, we believe more efficient cost functions could be devised.
Additionally, the ideas outlined here could be applied to other wave-function ansätze.
For example, in recent works~\cite{yoshioka2019,hartmann2019,nagy2019,vicentini2019}, neural networks have been optimized with variational Monte Carlo to describe the steady state of dissipative dynamics.
Such techniques could be adapted to perform the optimization described in this paper.

\begin{acknowledgments}
We would like to thank E. Demler, F. Verstraete and T. Shi for useful discussions.
This work was partially funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany's Excellence Strategy---EXC-2111---390814868 and by the European Union through the ERC grant QUENOCOBA, ERC-2016-ADG (Grant No. 742102).
\end{acknowledgments}

redpajama_set_name: RedPajamaArXiv


The New York Times reported back in 2009 that 95% of blogs are abandoned, and there's little evidence that state has changed much since then. Of course, a steady stream of crappy content won't attract a large or loyal readership. Quality matters. And it takes time for a new blog to build an audience; blogging is not for those who crave instant gratification.
But blogging success is impossible without regular posting. Marketers who blog consistently are far more likely to see positive ROI and generate significantly more leads. So while persistence alone won't guarantee blogging success, it will at least put you in the top 5% of all those who aspire to it.
In any serious pursuit, success is rarely achieved by "winging it." Top athletes work out on a regular schedule. The best musicians practice on a regular schedule. Similarly, writing high-quality blog content on a consistent basis requires writing on a regular schedule.
That said, there's no magic formula—do whatever works best for you. Set aside a certain number of hours each morning to write. Or right after lunch. Or every evening. Or, if your blog is more of a part-time endeavor, a couple of hours every Saturday morning. Do whatever works best for you. But do it consistently.
Writing well is hard work. If your heart isn't in it, it becomes a chore. At that point, your blog becomes easy to put it off…and ends up among the 95%.
But writing about something you care about, something you'd think about a lot even if you weren't blogging, some topical area or subject that fascinates you endlessly, doesn't feet like a chore. It's work, sure, but the kind of work that absorbs you, that gets you into a flow state.
Write about things you really care about. Your passion will come through in your writing, making it much more likely to attract and hold an audience. And it will seem much less like work.
4) It's not (just) about lead gen or sales—it's about relationships.
To be sure, a thoughtfully written business blog can generate leads (and sales). In my consulting days, I attracted new clients through this blog, and I worked with companies that generated some pretty respectable lead gen and conversion rate figures through blogging.
But focusing too much on generating leads (writing about your products and services rather than trying to be truly helpful) can backfire. Provide value first. Other good things will follow.
And the primary benefit I've realized (as have many others) from this blog is the relationships I've established and built over the years—some of which have led to business opportunities, all of which have led, at the very least, to interesting conversations. Without Webbiquity, I'd never have had the chance to get to know amazing people like Cheryl Burgess, Michael Brenner, Shelly Kramer, TJ McCue, Lisa Buyer, Randy Fougere, Carla Johnson, Andrew M. Smith, Marissa Pick (my "adopted cousin"), Tony Karrer (my co-founder at the B2B Marketing Zone), Judy Bellem, Brian Carroll, Meghan Biro, Kent Huffman, Jennifer Kane, Patrick Strother, Wendy Marx, Aric Hanson, Angie Schottmuller, Lee Odden, or Mykl Roventine.
5) Be grateful for your readers.
Like the philosophical conundrum of the tree falling in the forest, a blog needs readers in order to "make a sound." The ultimate value of a blog—as an ecommerce vehicle, a lead gen platform, an advertising-driven content site, or even a mere exercise in vanity—is determined by the quality and size of its audience.
Work to understand who these people are, and why they take time out of their very busy days to read your musings. Treat them well. Don't bombard them with spam, pop-ups, or low-grade filler posts. Strive to make every entry worth your time to write, and worth their time to read.
6) Be active on social media.
Granted, this advice is about as surprising and controversial as "eat more fruits and vegetables" at this point, but social media benefits blogging in so-o-o-o many ways. According to Forbes, 92% of marketers say social media is important for their business, and social media drives about a third of all referral traffic—or 5% to 15% of total traffic for the typical blog. It helps you build a network of other bloggers and readers interested in your industry or topic area.
It helps you attract guest writers to your blog and generate opportunities to guest-post elsewhere. It helps earn high-quality links to your blog. It gets you quoted and cited. It gets you invited to contribute to "expert" blog roundups. It helps you win awards and recognition. It's a phenomenal source for content curation. It helps keep you connected and informed.
7) It helps (a lot) to recognize others.
As you conduct research for your blog posts and expand your social media networks, you'll likely find there are certain individuals whose content you read, comment on, link to, and/or quote on a regular basis. Because it's remarkable.
It's good manners (as well as, in the long run, good for growing your social and search traffic) to mention those individuals by name in your posts and updates. These experts can also serve as go-to sources for "expert round-up" type blog posts. People like seeing their names pop up. Which is why posts like 95 Experts Reveal Best SEO Tools by Robbie Richards generate a lot of shares and a lot of blog visits.
You may also want to recognize your best sources, and more broadly the top experts in your industry or topic area, specifically in list posts on occasion. Done thoughtfully, these posts can attract significant readership over an extended period of time. For example, the #Nifty50 Women in Technology post here—a collaboration with Cheryl Burgess of Blue Focus Marketing—remains one of the 10 most-read Webbiquity posts of all time. It was still drawing dozens of visits per day several months after publication.
8) You don't have to write everything yourself.
Though your blog should always reflect your passion, it doesn't have to be limited to your words alone. Curating content in expert round up or best-of posts saves some of the time and effort of writing original content while also keeping your blog fresh by mixing things up a bit. For example, this roundup of guides to beautiful and effective website design is one of the most popular posts here in the last three years.
Another useful approach is to publish guest posts and let people know how to contribute to your blog. You can also reach out to bloggers you admire (see lessons #4 and #7 above) and invite them to write for your blog. Offer to cross post (you write something for their blog, they write something for you to publish) in order to reach a new audience.
9) Keep it positive; most people are chill.
This is as true online as in real life. Of course, some people aren't. But blogging and social media are no place to settle scores or expose bad actors.
That's even more important on the web. In real life, harsh words may be forgotten over time. Online, they live forever, potentially reflecting as badly on you as on your target. Be generous in praising those who deserve it. Trust that the universe, or karma, or some greater power will deal with those who deserve otherwise.
Unless you actually write a purely political or personal blog, avoid commenting about candidates for office or emotionally charged social issues. There's no upside for business bloggers. You won't pick up any new business, but you will risk alienating current and potential future customers.
Now, that does not mean you should avoid writing about controversies specific to your industry. Taking a stand on a disputed matter within your business area, such as whether or not it's possible to measure the ROI of social media, is an opportunity to stand out and to demonstrate your expertise.
11) Analytics are important—but use them the right way.
Google Analytics provides a treasure trove of website visitor data, for free. But it supplies so much information, it can be easy to get distracted by superficial metrics. For example, expert roundups (as noted above) tend to be powerful traffic drivers. But relying too heavily on them could erode a blog's unique value over time. Here are three key measures to watch.
Visitor quality. Look beyond which posts simply draw the most traffic to determine which provide the most value, in terms of average time spent and (lowest) bounce rate. If you track conversions (e.g., ebook downloads), it's vital to understand what types of posts are most effective at compelling your readers to take action.
Traffic sources. Watching the trends in how visitors find your blog helps optimize each tactic. Organic search is the top source of traffic for most blogs; use tools like the Yoast SEO plugin and Google Search Console (formerly Webmaster Tools) to keep SEO efforts on track. Referring sites and social media are also important sources. Use analytics trend data to help tune your timing and tactics.
Data quality. Though Google Analytics is valuable, it's not perfect "out of the box." It logs every visit to your site, even those that provide no value or insight. Use filters and segments to exclude data about visits from spammy referral sites, random bots, and aspiring hackers, so you can focus on analyzing the visits that matter.
12) Be careful with syndication.
Syndicating your content—republishing it elsewhere on popular multi-author sites—can be great way to increase exposure to your writing. But it can also kill your SEO. In theory, you can retain "credit" with Google and other search engines by using a rel canonical tag in each of your posts. But syndication sites don't have to respect these, and some will strip them out—and replace your tags with their own.
Evaluate the content syndication sites you're considering by looking at their source code to see if they honor the original authors' rel canonical tags. Note that even if the answer is "no," the increased exposure may be worth the potential loss of search traffic. But it's at least good to know.
Syndicate your content selectively (if possible). You may choose to syndicate timely content (e.g., "Five Things to Know About Google's Latest Algorithm Update") but not evergreen content that's likely to draw more search traffic over time (e.g., "The Complete History of Google Algorithm Updates").
Look into content curation sites like B2B Marketing Zone and Social Media Informer, which can help increase exposure to your content without risking your search traffic (since they publish only a a small snippet of your content but send visitors to your site for the full post). These are more selective than some syndication sites, but if your writing is professional-grade and fits the site topically, they're an option worth looking into.
Those are a dozen of the lessons I've learned from writing 1,000 blog posts (and life in general). Looking forward to whatever lessons come next.