Saturday, November 30, 2024

China_White

 What is the illegal drug fentanyl and where is it produced?

Fentanyl is a synthetic opioid that is extremely potent—up to 100 times stronger than morphine and 50 times stronger than heroin. It is used medically to treat severe pain, but it has also become a major player in the illegal drug market due to its high potency and low production cost.

Illicit fentanyl is primarily produced in clandestine laboratories. Historically, much of the illegal fentanyl has been manufactured in China and then trafficked to other countries, including the United States. However, production has also shifted to other regions. For instance, Mexican cartels have become significant producers of fentanyl, using precursor chemicals often sourced from China. In Canada, organized crime groups have increasingly turned to domestic production, creating fentanyl in local "superlabs".

The widespread availability and potency of fentanyl have led to a surge in overdose deaths, making it a critical public health issue.


Is there a particular name by which fentanyl is known on the street?

Yes, fentanyl goes by several street names. Some of the common ones include "Apache," "China Girl," "Dance Fever," "Goodfella," "Murder 8," "Tango & Cash," and "Jackpot". These names are often used to disguise the drug's identity, especially in conversations meant to avoid detection by law enforcement.

                                                         *     *     *

Trump camp says China is ‘attacking’ U.S. with fentanyl. A fight looms

More_Mitiq

 Mitiq does have a Dynamic Decoupling option, but seems unlike that in Qiskit.

Here, the various gates undergo back and forth rotations. It does affect results. The

code (Merlin), below:

                                                       







A run of the same code without enabling the decoupling:

                                                                       


*     *     *

Also looked up RichardsonFactory from yesterday's code. It is an extrapolation 

method, that sppeds things up.




             









                                                                                          









                                                                 

Friday, November 29, 2024

ZNE_Moment

 Went back to Qiskit this morning. The most recent version of things does not allow one

to simulate resilience directly. I ended up importing mitiq, which is a python module for

error mitigation. It has a ZNE function, so I used that with StatevectorEstimator. Code from

perplexity ai:






The circuit was deemed too short, so I did a second run:

                                                                                       







                                                                                

https://www.perplexity.ai/search/qiskit-i-would-like-to-use-sta-xcWo0YzdS36iWrEMyFXByg#14

                                                                  *     *     *

In effet, using mitiq in a simulation is something of an oddity. It follows a

procedure working from discrete noise readings to estimate zero-noise. In a simulation,

departues from strict parity are worked in at each run. 

Below, Copilot's description of how mitiq 'gets the job done':

Zero-Noise Extrapolation (ZNE) in Mitiq is an error mitigation technique that estimates the noiseless expectation value of an observable by extrapolating from measurements taken at different noise levels. Here's a simplified explanation of how it works:
Noise Scaling: The first step involves intentionally increasing the noise level in the quantum circuit. This can be done using various methods such as:
Unitary Folding: This method involves repeating certain gates in the circuit to increase the noise. For example, a gate 
G can be replaced with GG†G, effectively increasing the noise without changing the ideal outcome.
Identity Insertion: This method adds identity operations to the circuit, increasing the circuit's depth and thus the noise.
Pulse Stretching: For devices with pulse-level access, the duration of the pulses can be increased to scale the noise.
Extrapolation: After running the circuit at different noise levels, the next step is to fit a curve to these noisy results and extrapolate back to the zero-noise limit. This involves:
Collecting Data: Running the circuit multiple times at different noise levels and recording the expectation values.
Curve Fitting: Using mathematical models to fit a curve to the collected data points.
Extrapolation: Estimating the expectation value at zero noise by extrapolating the fitted curve.

Below, Copilot code to showcase ZNE with mitiq:

                                                                             


                                                                             
My input values for '00000' are  either all zeros or all 1s, not a realistic case at all.

And noise values are not linear. Still, the math pulls through...

I am looking forward to testing this on an actual Estimator run with a quantum 

computer😺





                                                                       










     

                                                                                                                   
       
  

    
                                                                                      
                                                                                                       











Thursday, November 28, 2024

Fruity Me

 Today is american Thanksgiving, which I like to celebrate in my own way. With

nice food. And why not!?


Meal 1 (it's 12:30):

                                                                           


In don't always feel like it, but my day goes so much better if I have fruit - and nothing but -

for breakfast. Looks nice...

HAPPY THANKSGIVING TO ALL!

                                                               *     *     *

Not trying to make light of this, by any means; but it looks like Ukraine is out of

luck on getting help with the 'Oreshnik' (walnut tree) missile. Chatting with Copilot,

below:

Is the American Military capable of stopping a missile that is going at 11 Mach?

The American military has developed several advanced missile defense systems designed to intercept and destroy incoming missiles, including those traveling at high speeds. However, intercepting a missile traveling at Mach 11 (approximately 8,400 miles per hour) presents significant challenges due to the speed and maneuverability of such missiles.

Key Missile Defense Systems
Ground-Based Midcourse Defense (GMD): Designed to intercept intercontinental ballistic missiles (ICBMs) during their midcourse phase using ground-based interceptors.

Aegis Ballistic Missile Defense (BMD): A sea-based system that uses Standard Missile-3 (SM-3) interceptors to target short to intermediate-range ballistic missiles.

Terminal High Altitude Area Defense (THAAD): A land-based system that intercepts ballistic missiles during their terminal phase.

Patriot Advanced Capability-3 (PAC-3): A mobile system designed to intercept short to medium-range ballistic missiles, cruise missiles, and aircraft.

Challenges
Intercepting hypersonic missiles (those traveling at speeds greater than Mach 5) is particularly difficult due to their high speed, maneuverability, and lower flight altitude compared to traditional ballistic missiles. The U.S. is actively developing new technologies and systems to address these challenges, including the Glide Phase Interceptor (GPI) and other advanced interceptors.

While current systems provide some level of defense, the effectiveness against hypersonic threats is still an area of ongoing research and development.

If you have any other questions or need further details, feel free to ask!

                                                                                *     *     *
Meal 2 (late afternoon): made a salmon sandwich...
                                                                                        

Meal 3 (bedtime): added frozen ricotta cake bits to cereal!

                                                                            


Wednesday, November 27, 2024

Devaluation_Blues

 For those who may be wondering, 1962 was the year when the Canadian

Dollar lost its footing. It was brought down to 92.5 cents, and this was a thing

debated all over television. I was twelve at the time, and it is my earlist memory

of following politics. Thought the whole affair was just a big con that was going to cost

my generation dearly down the line. AmIRight?

                                                                        
Source: Wikipedia, Diefenbaker

Asked Copilot to explain the circumstances to me, from the vantage point of the present:

                                                                           

Still sounds like a big con...

Was sitting inside a Walmart earlier today, at the entrance to a McDonalds, resisting the urge to 

crawl inside for a cup of coffee. (Am doing great on no caffeine since March 12, 2024.

REALLY!) 

Lady seemed upset about the immident demise of the dollar, gent arguing

that  it didn't matter, prices would adjust...


Yes, prices adjust, but not necessarily to one's advantage. There are a lot of people

competing for certain goods, in particular American goods.. Did a quick check on prices 

since 1962, with the Bank ofCanada:

Fancy Car:

                                                                                 

Leather shoes:

                                                                                   


Snack Chocolate bar:

                                                                                 

I asked Copilot about admission to Disneyland, Anaheim, Ca. It was 1.60 for an adult 

and .60 for a child in 1962. Today:

The cost of admission to Disneyland in Anaheim varies depending on the type of ticket and the time of year. As of 2024, here are the prices for one-day tickets:

One-Day Ticket Prices

  • Ages 10 and up:

    • Tier 1: $119

    • Tier 2: $134

    • Tier 3: $154

    • Tier 4: $169

    • Tier 5: $184

    • Tier 6: $194

  • Ages 3-9:

    • Tier 1: $112

    • Tier 2: $127

    • Tier 3: $146

    • Tier 4: $160

    • Tier 5: $174

    • Tier 6: $183

One-Day Park Hopper Ticket Prices

  • Ages 10 and up:

    • Tier 1: $184

    • Tier 2: $199

    • Tier 3: $219

    • Tier 4: $234

    • Tier 5: $249

    • Tier 6: $259

  • Ages 3-9:

    • Tier 1: $163

    • Tier 2: $192

    • Tier 3: $211

    • Tier 4: $225

    • Tier 5: $239

    • Tier 6: $248

These prices are subject to change and can vary based on the day you visit. You can find more details on the official .


Fine, I was and remain a Slay Queen at heart. But it is so much nicer and fun to feel one is in a

position to enjoy things, even where one remains moderate!!




















The_Numbers

 Canada has a very long border with the US, some 8891 kilometers. What I was

surprised to learn, 83% os all arrests by US border patrols are made from Quebec 

crossings.


All the numbers below:

https://www.lapresse.ca/actualites/politique/2024-11-27/tarifs-douaniers-de-25/les-entrees-irregulieres-65-fois-plus-nombreuses-depuis-le-mexique.php

Tuesday, November 26, 2024

Good_to_Know

 Feels like stepping on the scales Monday morning...It's not the number of

qubits, its the number of shots (100,000). That's my current theory. time involved

for the 10qubit runs:

                                                               


Time involved for the 50qubit run, largely the same:

                                                                                 

                                                                       




Good to know what the service might eventually cost!!

Meanwhile, I am looking through simulations of error specification with the 

AerSimulator...

                                                           *     *     *

The protocol on each batch run was:

1- No mitigation.

2- Dynamic Decoupling (adding pulses on idle qubits).

3- Twirled readout with extinction (sandwiching between Pauli gates, then flipping).

4- Pauli Twirling(Pauli gates keep the qubits active).

5- Zero-noise extraplolation(there are various approaches).

Monday, November 25, 2024

Big Time

 Really hitting the Big Time with this tutorial code on error mitigation. I am asking

for 100,000 shots and getting the answer back in minutes. 

-The circuit is parametrizedfor efficiency, alternating single gates with 2-qubit gates.

(The values on the gates are random...).

-A mirror circuit is constructed. Without a barrier, the transpiler would create a circuit

with no gates; this setup runs the identity matrix.

-The transpiler does the work of optimizing the circuit, using 'generate_preset_pass_manager'. 

Each 'pass' looks for a given loose end it can tidy up, or simpify in the code. Of course, one might

design one's own pass manager.

-The whole is run from the Estimator primitive.

-One uses ISA configuration.


The code is really 5 jobs run in 'batch' mode. One with no error mitigation, then one

adds each error mitigation technique up to maximum. 


I am used to running code that takes a few seconds. I ran this code twice, one for 10

qubits and one for 50, and each took over 4 minutes to run. I have completely used

up my monthly allocation of computer time and can only get back on December1...

But that is really the whole point of the exercise. One can ask for more and better error

mitigation, but it will create overhead costs because it takes more computer time to run.

Below:

                                                                           


                                                                                


Result for a 50 qubit circuit:

                                                                                   


-I seem to have escaped error bars at the top of my results!?


Sunday, November 24, 2024

PartyTime

 American Thanksgiving this Thursday... 

Currently number 1 on the Charts:

DDecoupling

 After much back and forth, managed to specify error mitigation on a Sampler run.

Ran it twice, and the results were similar. Below:

                                        

                                        




Dynamic decoupling works by not letting any qubits be idle and thus accumulate errors...


What ran:

                                                                             


Random run on ibm_sherbrooke:

                                                                       


                                                                  *     *     *

There is an actual tutorial on turning various error mitigation protocols off and on; I'll

be looking at that next...

                                                                             

Saturday, November 23, 2024

The_Adventurous

 I have no excuses; been living it up vicariously through the adventures of

Sir Yacht...


Friday, November 22, 2024

Evolving_War

 Le Monde publishes an ongoing overview of the situation in Ukraine. Below,

Feb 24, 2022:

                                                                  


Nov 10, 2024:

                                                                               



*     *     *

On the quantum computing side, it's been a journey trying to learn how to use

the Estimator primitive. I asked for 127 qubits, then 65, then 10 and finally settled for 3.

Thus,  ended up with what  I needed, which is a baseline construct which will allow me

to test the utility of the various error mitigations approaches. Below:

                                                                         


One can construct a circuit but one does not measure it (this would collapse things).

 One is looking for an expectation value...

ChatGPT 3.5

qiskit; is it correct to say that in using Estimator, one doesn’t measure things…

Yes, that’s correct. When using the Estimator in Qiskit, you are not performing traditional measurements in the same way that you would in a quantum circuit. Instead, you are estimating expectation values directly from the quantum state representations without collapsing the state through measurement.

Key Points about the Estimator:
Expectation Values Without Measurement:

The Estimator computes expectation values by simulating the process mathematically rather than actually performing physical measurements on qubits. This allows you to obtain theoretical outcomes based on the given quantum circuit and observable.
Qiskit Runtime:

The Estimator is part of the Qiskit Runtime framework and is designed to perform operations more efficiently by leveraging quantum hardware capabilities. It can calculate expected values from the circuits defined in your code.
No State Collapse:

Traditional quantum measurements collapse the quantum state to one of the basis states, which can affect subsequent computations. In contrast, the Estimator evaluates expected outcomes based on the entire quantum state, allowing for a more cohesive analysis of quantum dynamics.
Applications:

The Estimator is particularly useful for variational algorithms and scenarios where you need estimates of expectation values without the overhead of multiple measurements, such as in quantum simulations and optimization problems.
Conclusion
In summary, when using the Estimator in Qiskit, you're focused on calculating expectation values for observables based on the quantum circuits you've defined, rather than directly measuring the states of qubits in a way that would collapse them. This approach allows for a more holistic view of quantum behavior and is efficient for many applications.

Thursday, November 21, 2024

TFI

 I was asked to explain 'diagonalization'. Here is what I found:

COPILOT code:

                                                                                 


GEMINI explanation:



https://g.co/gemini/share/b20aa02360ea


META AI code:

                                                                                

GEMIMI explanation:

https://g.co/gemini/share/72f47d5001d8

https://g.co/gemini/share/8a5884b14472                                                                                 


Error_M

 Still thinking quantum...

Thought I would start looking through various error mitigation techniques, what they are,

what they do. One can enable them within qiskit, run on a simulator but, to be real, run them

on an actual quantum computer. They are run on the Estimator primitives (as opposed to

the Sampler).


Errors can sometimes show up on idling qubits ie qubits not being called up while performing

a given operation.

Dynamical decoupling works by inserting pulse sequences on idling qubits to approximately cancel out the effect of these errors. Each inserted pulse sequence amounts to an identity operation, but the physical presence of the pulses has the effect of suppressing errors.

                                                  *     *     *

First, need to learn about using Estimator:

Primitives examples | IBM Quantum Documentation


This code snippet demonstrates how to:

  1. Initialize the Qiskit Runtime Service and select a backend.

  2. Create a quantum circuit using the IQP (Instantaneous Quantum Polynomial) circuit.

  3. Define an observable using the SparsePauliOp class.

  4. Transpile the circuit to match the backend's instruction set architecture.

  5. Initialize the Estimator primitive.

  6. Run the Estimator to calculate the expectation value of the circuit with the given observable.

  7. Print the expectation value and metadata.


                                                             

Measurement Basis:

                                                                              



Expectation Value: