portfolio optimisation with adiabatic quantum computing · 2018. 9. 24. · portfolio optimisation...
TRANSCRIPT
Portfolio Optimisation with
Adiabatic Quantum Computing
Alexei Kondratyev
Standard Chartered Bank
London Quantum Computing Meetup, 19 September 2018
2
Joint research project with
Davide Venturelli
Quantum Computing Lead
NASA-USRA Quantum AI Lab
Mountain View, CA
The Universities Space Research Association
Quantum computations performed on D-Wave 2000Q quantum annealer
based at NASA Ames Research Centre
3
Why quantum computing? – Quantum speedup
2N a2bN g
N 10 50 100 500
2N 1 millisecond 35.7 years 40x1015 years ∞
e√N 0.024 millisecs 1.2 millisecs 22 millisecs 1.4 hours
Single operation = 1 microsecond
Adiabatic Quantum Optimisation: aebN as N → ∞
b, g may be smaller than known classical algorithms
If we are only interested in approximate solution: aN as N → ∞
g
g
4
Why quantum computing? – Reversibility
Entropy in statistical mechanics Entropy in information theory
pi – the probability of the microstate i taken from an pi – the probability of the message i taken from the
equilibrium ensemble (macroscopic thermodynamic state) message space
Any probability distribution can be approximated arbitrarily closely by some
thermodynamic system
Gain in entropy = Loss of information
If h is information (bits) per particle, then for N particles (in nats)
In energy units: of heat is generated for each bit of information lost
Every logically irreversible operation (e.g., NAND or XOR operation) must be
accompanied by the corresponding entropy increase. Quantum computing operations
are reversible (no information is lost), except measurement.
𝑆 = −𝑘𝐵 ln 2 𝑁ℎ
𝑘𝐵𝑇 ln 2
𝑆 = −𝑘𝐵 𝑝𝑖 ln 𝑝𝑖
𝑖
Η = − 𝑝𝑖 log2 𝑝𝑖
𝑖
5
Why quantum computing? – Universal computers
Example: network of NAND gates (NAND is a universal logic gate)
Most non-trivial physical systems would be universal computers if they could be made
arbitrarily large and long-lasting
The fact that exactly the same computation can be performed on any universal
computer means that computation is substrate-independent
o It is possible to replace the hardware technology without changing the software
o What is the next most promising computational substrate?
Parallel processing – massive increase in computational power
The ultimate parallel computer is a quantum computer
o Quantum bits (qubits) can be in a superposition of 0 and 1 states
o ‘Quantum supremacy’ with as few as 100 qubits?
6
What is a qubit?
Binary digit (bit) is a building block of classical computational devices, which is a two-
state system: 0 ↔ 1
Quantum mechanics tells us that any such system can be in a superposition of states
In general, the state of a quantum bit (qubit) is described by: a0 + b1
where a and b are complex numbers, satisfying a² + b² = 1
Any attempt to measure the state a0 + b1 results in 0 with probability a² and 1
with probability b²
After the measurement, the system is in the measured state – further measurements
will always yield the same value
We can only extract one bit of information from the state of a qubit
7
Possible physical realisations of qubits
Superconducting loops Electrons Trapped ions and many others…
Superconducting loops
interrupted by Josephson
junctions
Qubit is represented by the
quantum states of electron
current in two directions (with
different magnetic flux)
Measurements via sensitive
magnetic field detectors
Control via applied
microwave fields
Coupling via magnetic fields
Fast gate times (~ ns)
Fast decoherence (~ 10 ms)
e¯
Qubit is represented by the
electron spin
Single qubit can be
manipulated via, e.g.,
microwave fields
2-qubit gates based on
spin-exchange interaction
Fast gate times (~ ns)
Fast decoherence (~ 10 ms)
e.g., ⁴³Ca⁺, ⁹Be⁺
Qubit is represented by the
internal atom state
1-qubit gate: addressing ion
with a laser
2-qubit gate: entanglement
via exchange of phonons of
quantized collective mode
Quantum computing as a
sequence of laser pulses
Read out by quantum jumps
Slow gate times (~ 10 ms)
Long coherence times (~ 10s)
Photons
(polarisation,
spatial parity)
Neutral atoms
(nuclear spins)
…
21SJSH
8
Quantum computing without logic gates
Quantum analog computer – Quantum Annealer
QA solves Quadratic Unconstrained Binary Optimisation (QUBO) problems
Example of a QUBO portfolio optimisation problem:
o Select M assets from the universe of N assets subject to some optimisation
criteria, e.g., maximisation of risk-adjusted return (Sharpe ratio)
o Objective function is quadratic in state variables
There is a one-to-one mapping between QUBO and Ising spin models
o Ising problem is solved on the quantum annealer
o The coding consists of configuring the local magnetic fields acting on each qubit
and specifying the coupling strength between qubits
9
The QUBO portfolio optimisation problem
The problem of selecting M equally weighted assets from the universe of N assets
without replacement
The qubit configuration: q = (q1, q2, . . ., qN) where qn = 1 means that asset n is selected
and qn = 0 means that asset n is not selected
Objective function:
Coefficients a reflect relative attractiveness of the individual assets
(e.g., large negative values for individually best assets – highest Sharpe ratios?)
Coefficients b reflect joint attractiveness of the pairs of assets
(e.g., large negative values for the anticorrelated assets that improve diversification)
N
i
N
i
N
ij
N
i
ijiijii qMPqqbqaqO1 1 1
2
1
QUBO )(
Penalty term for selecting
wrong number of assets
Expression to be minimised through
the choice of configuration q
10
QUBO to Ising
Ising objective function of N variables s = (s1, s2, . . ., sN) where each variable sn
corresponds to a physical Ising spin that can be in either +1 or –1 state:
Ising and QUBO models are related through the transformation s = 2q – 1, where 1 is
the vector all of whose components are 1. If we express QUBO problem as
then the QUBO-Ising transformation is
Local field applied on each spin
causes it to prefer either +1 or –1
state. The sign and magnitude of
this preference is reflected in h
There may also be couplings between spins i and j
such that the system prefers the pair of spins to be in
either of the two sets defined by si = sj or si = –sj. The
sign and magnitude of this preference is denoted J
N
i
N
i
N
ij
jiijii ssJshsO1 1 1
Ising )(
Xqqqq
,minargminarg
ji
jiji qXq
sXssX1X11Xqq )4/(,,2/,4
1,
11
The Quantum Annealer
To express the Ising Hamiltonian using a quantum mechanical description of spins,
we replace the spin variables with their respective Pauli matrices (operators):
Annealing parameter t slowly increases from 0 to 1 with A(0) ≫ B(0) and A(1) ≪ B(1)
The effect of B is to order spins along z axis, while A tends to destroy this order by
flipping the spin (Pauli matrix s ͯ )
Initial state Final state
(problem Hamiltonian)
N
i
N
i
N
ij
z
j
z
iij
z
ii
N
i
x
i JhtBtAtH1 1 11
)()()( ssss
12
Annealing process
SCHEMATIC
t t 0.3 0.4 0.5 0 0.5 1
A(t)
B(t)
Energy gap E1(t) – E0(t) between the
ground state and the first excited state
Smooth and slow transition from the initial to the final state to ensure that the system
stays in the ground state
0 0
DEmin
1
(DEmin)² T ~
13
Portfolio optimisation problem setup
Asset Return – Risk-Free Rate
Sharpe Ratio =
Asset Volatility
Continuous portfolio optimisation problem
m – expected return
s – covariance
w – investment amount (weight)
Quadratic programming with linear constraints
Discrete portfolio optimisation problem
Binary weights (0 and 1) encoded into an
Ising model – strong non-linearity
Shown to be NP-complete
Ising spin glasses are known to be NP-hard
problems for classical computers
Polynomial time mapping to other NP-
complete problems
14
Portfolio optimisation problem setup (continued)
Fund of Funds portfolio manager
o Short time series – monthly NAV per share observations over the last 12 months
o With N = 60 the correlation matrix of NAV log-returns may not be positive definite
o With M = 30 we have 60!/(30!)² ≈ 1.2×10¹⁷ possible combinations
We simulate multiple realisations of the N-asset portfolio dynamics
o All asset prices are assumed to follow GBM process with
Drift, m = 0.075
Expected individual asset
Volatility, s = 0.15 Sharpe ratio = 0.4
Uniform asset correlation, r = 0.1 Expected Sharpe ratio for the
equally weighted 60-asset
Risk-free rate was set at r0 = 0.015 portfolio = 1.4
The above and the following hypothetical examples are for illustrative purposes only and may not reflect your actual portfolio.
15
Problem encoding
We can use risk-adjusted returns of the individual assets to specify coefficients a
and the correlation matrix of asset returns to specify coefficients b
The choice of coefficients a and b as small integer numbers is dictated by the
technical realisation of the quantum annealer architecture
Sample problem encoding
Positive coefficient values penalise concentration
and small individual asset Sharpe ratios
Negative coefficient values reward diversification
and large individual asset Sharpe ratios
Lowest
Sharpe
ratio
Highest
Sharpe
ratio
The above and the following hypothetical examples are for illustrative purposes only and may not reflect your actual portfolio.
16
The classical benchmark – Genetic Algorithm
Solution – a vector q = (q1, q2, . . ., qN) with elements taking binary values: 0 and 1
1) Generation of L initial solutions through the random draw of q’s with restriction that
'1' is assigned to the values of exactly M elements and '0' is assigned to the values
of remaining N – M elements
2) Evaluation of the objective (fitness) function for each solution
3) Ranking of solutions from 'best' to 'worst' according to the objective function
evaluation results
4) Selecting K best solutions and producing L new solutions by randomly swapping
the values of two genes with opposite values. If L = m K then every one of the 'best’
solutions will be used to produce m new solutions
5) Evaluation of the objective function for each solution in the new generation
And so on until we have gone through the target number of iterations that
determines the maximum allowed number of objective function calls
17
GA: results for N=48 and M=24, mapping scheme B & D
The above and the following charts are based on own calculations. For illustrative purposes only.
Portfolio
Mean
Sharpe
Ratio
25th
%ile
75th
%ile
Full
portfolio
(N assets)
1.4 0.5 2.1
Optimal
portfolio
(M assets)
4.6 2.6 6.0
Top M
individual
performers
3.8 2.7 4.6
18
GA: convergence and scalability, mapping scheme B & D
The above and the following charts are based on own calculations. For illustrative purposes only.
Number of objective function calls ~N2.1 – N2.3
With objective function computation time ~N2, the total computation time ~N4.1 – N4.3
19
Sample D-Wave result for N=48 and M=24, scheme B & D
6 0 0 0 2 2 -2 0 0 2 0 0 -2 -2 0 2 0 2 0 0 2 0 2 0 0 -2 2 2 2 0 -2 -2 2 2 0 2 -2 0 2 2 2 2 0 2 0 2 2 -2
0 3 -2 0 2 2 0 2 0 2 -2 2 2 0 0 2 0 2 -2 0 0 -2 0 0 0 0 0 -2 0 -2 0 2 2 0 0 0 0 0 2 0 0 2 0 2 -2 0 0 0
0 -2 -9 2 -2 0 0 0 0 2 0 0 2 0 2 -2 0 2 0 2 2 2 2 0 2 0 2 2 0 0 2 -2 0 2 0 2 -2 0 0 0 2 2 0 0 2 0 0 0
0 0 2 -15 -2 2 0 0 0 2 0 -2 0 0 0 0 -2 0 0 2 2 0 0 -2 0 -2 0 2 -2 0 2 0 0 2 0 0 -2 0 0 0 2 0 0 2 0 2 2 0
2 2 -2 -2 0 0 0 2 0 0 0 0 0 0 -2 0 2 -2 -2 -2 -2 0 -2 2 0 0 0 -2 2 0 -2 2 2 -2 0 0 2 0 2 0 0 0 -2 0 0 0 0 0
2 2 0 2 0 6 -2 0 2 2 -2 2 2 -2 2 2 0 2 0 0 0 0 0 0 0 0 0 0 -2 -2 0 2 2 0 -2 0 -2 0 2 -2 -2 2 2 2 -2 2 2 0
-2 0 0 0 0 -2 6 0 -2 2 2 -2 0 0 -2 -2 2 0 2 0 0 -2 0 0 0 2 0 0 -2 -2 2 -2 0 -2 0 -2 2 2 -2 2 2 -2 -2 -2 0 -2 -2 2
0 2 0 0 2 0 0 3 0 0 -2 -2 2 2 0 -2 2 0 -2 0 0 -2 -2 2 0 2 0 -2 2 0 0 2 2 0 2 0 -2 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 2 -2 0 2 2 0 0 -2 0 2 0 2 0 0 0 0 2 15 0
-2 0 0 0 0 0 2 0 0 0 2 0 2 0 0 -2 0 -2 0 0 -2 0 0 2 0 2 0 0 0 0 0 2 -2 -2 0 -2 2 0 -2 0 -2 -2 2 -2 0 -2 0 6
Optimal portfolio:
[ 0 0 1 1 1 0 1 1 1 0 1 1
0 1 1 1 1 0 1 0 0 1 0 0
1 0 0 1 0 1 1 1 0 1 1 0
1 0 1 0 0 0 0 1 0 0 0 0 ]
Objective function value (minimum energy): -133
Sample QUBO coefficients:
The above and the following charts are based on own calculations. For illustrative purposes only.
-15 -12 -9 -6 -3 -2 -1 0 1 2 3 6 9 12 15
20
Time-to-solution
The TTS is defined as the time needed for a heuristic, either classical or quantum,
to find solution with a% success probability
trun – annealing time (D-Wave)
p – probability of finding an optimal solution in a single run (D-Wave)
With a = 99% and p = 0.04% for N = 48 we need to run D-Wave annealer
ln(0.01)/ln(0.9996) = 11,510 times
With annealing time = 1 ms, total effective running time ≈ 12 ms
For comparison: GA objective function computation time for N = 48 is 20 ms (desktop)
Number of objective function calls ≈ 25,000 (99% confidence level)
Total effective running time ≈ 500 ms
𝑇𝑇𝑆 = 𝑡run
ln(1 − 𝛼)
ln(1 − 𝑝)
21
QA: TTS as a function of problem size, scheme B & D
The above and the following charts are based on own calculations. For illustrative purposes only.
22
Quantum Annealing vs. Genetic Algorithm
For all problem sizes we established a 1-3 order of magnitude QA speedup over
a classical GA run on a standard processor. However, this result refers to the
effective running time where different types of overhead computing costs were
ignored:
o Readout of results and system reset for QA
o Random number generation, sorting algorithm, mutation function for GA
Constrained and unconstrained problems have inverse difficulties classically
and quantumly. While unconstrained problem is more difficult classically due to the
larger solution space the opposite is true for the quantum annealer. Encoding of
constraint via penalty function affects precision of the quantum annealer and increases
the effective running time.
QA does not scale better with the problem size than classical GA for the given
problem encoding schemes. In other words, portfolio optimisation problem encoded
by the mapping schemes A – D may be an easy one for classical algorithm.
23
Two further directions of scalability analysis
Optimal trun as a function of problem size
More complex encoding schemes. For example:
24
QA: TTS as a function of problem size
The above and the following charts are based on own calculations. For illustrative purposes only.
Unconstrained portfolio optimisation problem
25
The hybrid approach – reverse annealing
1) Classical pre-processing stage based on a fast greedy search heuristic. The
system quickly reaches a local minimum that becomes a starting point for the
quantum annealing.
2) We apply backward annealing to get away from the local minimum to the point
where A(t) and B(t) are of the same magnitude (annealing parameter t 0.4).
3) The system pauses for twice the time of backward annealing to allow for quantum
tunnelling.
4) The system anneals forward to the final state (B(1) ≫ A(0)), which is more likely to
be a global minimum in comparison with starting quantum annealing from some
random initial state. The forward annealing time is the same as the time of
backward annealing.
26
Reverse annealing process
SCHEMATIC
0 t 2t
0
3t 4t
Backward
annealing
Forward
annealing
Quantum tunnelling
annealing parameter
t 0.4
Transverse
magnetic
field
Longitudinal
magnetic
field
27
Reverse annealing results for QA and GA
The above and the following charts are based on own calculations. For illustrative purposes only.
Unconstrained portfolio optimisation problem
28
TTS as a function of annealing parameter t
The above and the following charts are based on own calculations. For illustrative purposes only.
Our results suggest that the optimal reverse annealing schedule should be to perform reverse annealing
to the transverse magnetic field strength that corresponds to the annealing parameter t 0.4
29
Dependency of RA results on problem complexity
The above charts are based on own calculations. For illustrative purposes only.
correlation = 32% correlation = 45%
Hamming distance between the ground state and the best solution found with forward annealing is the
number of positions (assets) with different qubit values
30
Appendix
31
What is computation?
A computation is a transformation of one memory state into another
A computation takes information and transforms it, thus implementing a function
Logic gates – functions that operate on bits (0 and 1)
NAND (NOT AND) Logic Gate Truth Table
A B X
0 0 1
0 1 1
1 0 1
1 1 0
A
B
X NAND
32
NAND is a universal logic gate
NOT gate
(Inverter )
AND gate
(Logical conjunction)
OR gate
(Logical disjunction)
Exclusive OR gate
(Exclusive disjunction)
= A
B AND X
A
B NAND X NAND
A
B OR X =
NAND
NAND
NAND X
A
B
A
B XOR X =
NAND
NAND
NAND X NAND
A
B
X NOT A = X NAND A
33
Computing example: summation of bits
= NAND
NAND
+
NAND
XOR XOR
Input: 3 separate bits
Output: 2-bit binary number
Output
0 0 0 00
0 0 1 01
0 1 0 01
1 0 0 01
0 1 1 10
1 0 1 10
1 1 0 10
1 1 1 11
Input
34
Possible physical realisations of NAND gate
Relay Logic Resistor-Transistor Logic CMOS Logic (Complimentary Metal-Oxide-Semiconductor)
+3V
A
B
X
A B
X
A B
A
B
X
+3V +3V
Switches are interpreted as bits
with 0 = open and 1 = closed.
When switches A and B are both
closed, an electromagnet opens
the switch X.
Voltages are interpreted as bits with
0 = zero volts and 1 = 3 volts.
When wires A and B are both at +3
volts the two transistors conduct
electricity and the wire X drops to
zero volts.
PMOS circuit between the voltage and
the output. PMOS transistor is open
when the input is 1 (+3 volts) and
closed when the input is 0 (zero volts).
NMOS circuit between the output
and ground. NMOS is logical
opposite of PMOS.
1930s 1950s 1970s
35
The Bloch sphere
f
q
y
z
y
x
State y = a0 + b1 with a² + b² = 1 can be
represented by
for q in [0, p] and f in [0, 2p]
It is the canonical representation of a qubit
Default basis is z-basis (North / South axis)
|ψ = cos
θ2
eiϕ sinθ2
36
Qubit as a vector in ℂ²
The state of a qubit is a unit vector in the 2-dimensional complex vector space
The vector can be written as a0 + b1 , where and
Any pair of linearly independent vectors f, y ∊ ℂ² could serve as a basis
a0 + b1 = a′f + b′y
Example The vector measured in the basis and
gives either outcome with probability 1/2 (a = 1/√2, b = 1/√2)
When measured in the basis and
it gives the first outcome with probability 1 (a′ = 1, b′ = 0)
b
a
0
10
1
01
2/1
2/1
0
10
1
01
2/1
2/1f
2/1
2/1y
37
Entanglement
An N-qubit system can exist in any superposition of the 2ᴺ basis states
If such a state can be represented as a tensor product of individual qubit states then
the qubit states are not entangled
For example:
Which of these two 2-qubit states are entangled? A) B)
A) If we measure the first qubit, we see 0 with probability 1 and the state remains
unchanged
B) Measuring the first qubit gives 0 or 1 with equal probability.
After this, the state of the second qubit is also determined
12
0
2
1210 1,11...11....01...0000...00
N
N
n
ncccc
102
110
2
111100100
2
1
01002
1 1100
2
1
102
110010100
2
1
38
Quantum logic gates – Pauli gates
In the spin 1/2 case, Pauli matrix sᶻ has two eigenvalues 1, which correspond to a
spin being either parallel (state 0) or antiparallel (state 1) with z axis.
If we take , then taking these two eigenvectors as the standard
(computational) basis that privileges the z-direction:
In z-basis, Pauli matrix s ͯ flips the spin, i.e. it acts on a single qubit as a NOT gate:
And Pauli matrix sᶻ flips the phase (rotation around z axis by p radians):
0
10
1
01
01
10xs
0
0
i
iys
10
01zs
,1
0
0
1
01
10
,
0
1
1
0
01
10
,10 xs 01 xs
,0
1
0
1
10
01
,
1
0
1
0
10
01
,00 zs 11 zs
39
Quantum logic gates – Hadamard gate
In quantum computing all operations on qubits (except measurement!), i.e. all quantum
logic gates, are represented by unitary matrices (unitary operators are norm-preserving
and invertible)
Observe that a unitary matrix H:
transforms from z-basis to x-basis:
and maps the basis state 0 to (0 + 1)/√2 and the basis state 1 to (0 – 1)/√2 .
This means that a measurement will have equal probabilities to become 0 and 1,
i.e. it creates a superposition
There is no analogue of Hadamard gate in classical computing
xzHH ss *
,11
11
2
1
H IHH *
40
Quantum logic gates – Toffoli gate
All quantum logic gates are reversible (preservation of information). Classical NAND
gate is not reversible (no one-to-one mapping between the inputs and outputs).
Reversible universal classical gate is Toffoli gate (controlled controlled NOT)
Quantum Toffoli gate is the same gate defined for three qubits. If the first two qubits
are in the state 1, it applies a Pauli-X (or NOT) on the third qubit, else it does nothing
Truth Table Toffoli Gate
with C = 1 it can be viewed as
a NAND gate: C’ = A NAND B
0100
1000
0010
0001
0000
0000
0000
0000
0000
0000
0000
0000
1000
0100
0010
0001
Quantum Toffoli gate is not universal in quantum computing –
we cannot construct an entangled state with Controlled NOT
gates alone – we need to add the Hadamard gate to do this
A B C A' B' C'0 0 0 0 0 0 0 1 0 0 1 01 0 0 1 0 01 1 0 1 1 10 0 1 0 0 10 1 1 0 1 11 0 1 1 0 11 1 1 1 1 0
Input Output
41
Possible physical realisation of CNOT gate
Photonic Qubits
2010s
Control
Target Non-Linear
Phase Shift
C0,in = 0
C1,in = 1
T0,in = 0
T1,in = 1
C0,out
C1,out
T0,out
T1,out
BS BS
H Z H
=
The CNOT, or CX, operation can be described in
terms of a CZ gate. The X gate can be
decomposed as a sequence of three single qubit
gates, two Hadamard gates and a Z gate, so
that X = HZH and CNOT = (I ⊗ H) CZ (I ⊗ H).
When the control is |0, the two Hadamard gates
cancel each other and, when it is |1, the
combination of gates acts as a NOT.
The two paths used to encode the target qubit are mixed at a 50% reflecting beam
splitter (BS) that performs the Hadamard operation. If the phase shift is not applied, the
second beam splitter (Hadamard) undoes the first, returning the target qubit exactly the
same state it started in (example of classical interference).
If p phase shift is applied i.e. non-classical interference is occurred and target qubit is
flipped, the NOT operation occurs, i.e. |0 |1 and |1 |0. When control qubit is |0,
then phase shift is not applied and when control qubit is |1, then phase (p) shift is
applied. So this phase shifting operation is non-linear phase shift. A CNOT gate must
implement this phase shift when the control photon is in the |1 path, otherwise not.
42
Bibliography
K. K. Biswas and S. Sajeed. Design and realization of a quantum Controlled Not gate using optical implementation.
International Journal of Advancements in Research & Technology, 1(1) (2012)
S. Boixo et al. Computational multiqubit tunnelling in programmable quantum annealers. Nature Communications, 7(10327) (2016)
E. Dahl. Programming with D-Wave: Map Coloring Problem. D-Wave White Paper (2013)
A. Daley. Physical implementations of quantum computing (2014)
A. Dawar. Quantum Computing – Lectures (2004)
V. Denchev et al. What is the Computational Value of Finite-Range Tunneling? Physical Review X, 6(031015) (2016)
D. Deutsch. Quantum theory, the Church-Turing principle and the universal quantum computer.
Proceedings of the Royal Society of London, A 400 (1985)
D-Wave. Technical Description of the D-Wave Quantum Processing Unit. User Manual (2017)
R. Feynman. Simulating Physics with Computers. International Journal of Theoretical Physics, 21(6/7) (1982)
J. C. Garcia-Escartin and P. Chamorro-Posada. Equivalent Quantum Circuits. arXiv:1110.2998 (2011)
G. Kirchmair et al. High fidelity entanglement of 43Ca+ hyperfine clock states. Physical Review A, 79(020304) (2009)
A. Lucas. Ising formulations of many NP problems. Frontiers in Physics, 2 (2014.00005) (2014)
R. Lyndon. Introduction to Q# Development: Can We Use Entanglement to Thwart Heisenberg? (2018)
S. Mandra and H. Katzgraber. A deceptive step towards quantum speedup detection. arXiv:1711.01368 (2017)
M. Marzec. Portfolio Optimization: Applications in Quantum Computing. SSRN 2278729 (2014)
G. Rosenberg et al. Solving the optimal trading trajectory problem using a quantum annealer.
Proceedings of the 8th Workshop on High Performance Computational Finance, Article No. 7 (2015)
T. Stollenwerk et al. Quantum Annealing Applied to De-Conflicting Optimal Trajectories for Air Traffic Management.
arXiv:1711.04889 (2017)
M. Tegmark. Life 3.0. Penguin (2017)
S. Toyabe et al. Information heat engine: converting information to energy by feedback control. Nature Physics 6(12) (2010)
D. Venturelli et al. Quantum Annealing Implementation of Job-Shop Scheduling. arXiv:1506.08479 (2015)
D. Venturelli et al. Quantum Optimization of Fully-Connected Spin Glasses. Physical Review X, 5(031040) (2015)
43
General Disclaimer
This communication has been prepared by Standard Chartered Bank. Standard Chartered Bank is incorporated in England with limited liability by Royal Charter 1853
Reference Number ZC18. The Principal Office of the Company is situated in England at 1 Basinghall Avenue, London, EC2V 5DD. Standard Chartered Bank is authorised
by the Prudential Regulation Authority and regulated by the Financial Conduct Authority and Prudential Regulation Authority.
Banking activities may be carried out internationally by different Standard Chartered Bank branches, subsidiaries and its affiliates (collectively “SCB”) according to local
regulatory requirements. With respect to any jurisdiction in which there is an SCB entity, this document is distributed in such jurisdiction by, and is attributable to, such
local SCB entity. Recipients in any jurisdiction would contact the local SCB entity in relation to any matters arising from, or in connection with, this document. Not all
products and services are provided by all SCB entities.
This material is provided for general information purposes only and does not constitute either an offer to sell or the solicitation of an offer to buy any security or any
financial instrument or enter into any transaction or recommendation to acquire or dispose of any investment.
The information contained herein does not purport to identify or suggest all the risks (direct or indirect) that may be associated with conducting business.
This communication is prepared by personnel from SCB’s Sales and/or Trading Desks. It is not research material and is not a product of SCB’s Research.
Any views expressed may differ from those of SCB’s Research. This material has been produced for reference and is not independent research or a research
recommendation and should therefore not be relied upon as such. The material has not been prepared in accordance with legal requirements designed to promote the
independence of investment research. This material is not subject to any regulatory prohibition on dealing ahead of the dissemination of investment research.
This material is provided on a confidential basis and may not be reproduced, redistributed or transmitted, whole or in part, without the prior written consent of SCB.
This communication is not independent of SCB’s own trading strategies or positions. Therefore, it is possible, and you should assume, that SCB has a material interest in
one or more of the financial instruments mentioned herein. If specific companies are mentioned in this communication, please note that SCB may at times seek to do
business with the companies covered in this communication; hold a position in, or have economic exposure to, such companies; and/or invest in the financial products
issued by these companies.
SCB may be involved in activities such as dealing in, holding, acting as market makers or performing financial or advisory services in relation to any of the products
referred to in this communication. The Sales and Trading personnel who prepared this material may be compensated in part based on trading activity. Accordingly, SCB
may have a conflict of interest that could affect the objectivity of this communication.
This communication should not be construed as a recommendation (except to the extent it is an “investment recommendation” under MAR (as defined below)) for the
purchase or sales of any security or financial instrument, or to enter into a transaction involving any instrument or trading strategy, or as an official confirmation or official
valuation of any transaction mentioned herein.
The information provided is not intended to be used as a general guide to investing and does not constitute investment advice or as a source of any specific investment
recommendations as it has not been prepared with regard to the specific investment objectives or financial situation of any particular person.
44
General Disclaimer (continued)
SCB does not provide, and has not provided, any investment advice or personal recommendation to you in relation to the transaction and/or any related securities
described herein and is not responsible for providing or arranging for the provision of any general financial, strategic or specialist advice, including legal, regulatory,
accounting, model auditing or taxation advice or services or any other services in relation to the transaction and/or any related securities described herein. The particular
tax treatment of a service or transaction depends on the individual circumstances of each client and may be subject to change in the future. Accounting laws, rules,
regulations, standards and other guidelines may differ in different countries and/or may change at any time without notice. SCB may not have the necessary licenses to
provide services or offer products in all countries or such provision of services or offering of products may be subject to the regulatory requirements of each jurisdiction and
you should check with your advisors before proceeding. Accordingly SCB is under no obligation to, and shall not determine the suitability for you of the transaction
described herein.
You must ensure that you have sufficient knowledge, experience, sophistication and/or professional advice to make your own evaluation of the merits and risks of entering
into such transaction. You are advised to make your own independent judgment (with the advice of your professional advisers as necessary) with respect to the risks and
consequences of any matter contained herein.
While reasonable care has been taken in preparing this document, SCB expressly disclaims any liability and responsibility for any damage or loss you may suffer from
your use of or reliance of the information contained herein.
Any past or simulated past performance including back-testing, modelling or scenario analysis contained herein is not an indication of future performance or results.
Changes in rates of exchange may have an adverse effect on the value of investments. No representation is made as to the accuracy of the assumptions made within, or
completeness of, any modelling, scenario analysis or back-testing.
Predictions, projections or forecasts contained herein are not necessarily indicative of actual future events and are subject to change without notice. You are cautioned not
to place undue reliance on such statements. While all reasonable care has been taken in preparing this communication, SCB makes no representation or warranty as to its
accuracy or completeness.
Any opinions or views of third parties expressed in this material are those of the third parties identified, and not of SCB. Some of the information appearing herein may
have been obtained from public sources and while SCB believes such information to be reliable, it has not been independently verified by SCB.
All opinions and estimates are given as of the date of the relevant document and are subject to change without notice. The value of any investment may also fluctuate as a
result of market changes. SCB is not obliged to inform the recipients of this communication of any change to such opinions or estimates.
Where this material is an “investment recommendation” as defined in Article 3(1)(35) of the EU Market Abuse Regulation (“MAR”), distribution of this material is subject to
the relevant provisions of MAR. For more information, please consult the MAR disclosures website.
This communication is not directed at Retail Clients in the European Economic Area as defined by Directive 2004/39/EC.
© 2018 Copyright Standard Chartered Bank and its affiliates. All rights reserved. All copyrights subsisting and arising out of these materials belong to Standard Chartered
Bank and may not be reproduced, distributed, amended, modified, adapted, transmitted in any form, or translated in any way without the prior written consent of Standard
Chartered Bank.