Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Commit 1ef1b29

Browse files
committed
Updated Readme
1 parent 845fa2a commit 1ef1b29

File tree

1 file changed

+23
-17
lines changed

1 file changed

+23
-17
lines changed

README.md

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -96,41 +96,47 @@ Generate ~100K atomic coulomb matrices = 0.22s
9696

9797
Example 1: Using a coulomb matrix
9898

99-
from qml.kernels import laplacian_kernel
100-
101-
comps = ... # load a Python list of Compunds
99+
```python
100+
from qml.kernels import laplacian_kernel
102101

103-
for comp in comps:
104-
comp.generate_coulomb_matrix()
102+
comps = ... # load a Python list of Compunds
105103

106-
training = comps[:1000]
104+
for comp in comps:
105+
comp.generate_coulomb_matrix()
107106

108-
K = laplacian_kernel(training, training, sigma=100.0)
107+
training = comps[:1000]
109108

109+
K = laplacian_kernel(training, training, sigma=100.0)
110+
```
110111

111112
Example 1: Using ARAD representation
112113

113-
from qml.kernels import arad_kernel
114+
```python
115+
from qml.kernels import arad_kernel
114116

115-
comps = ... # load a Python list of Compunds
117+
comps = ... # load a Python list of Compunds
116118

117-
for comp in comps:
118-
comp.generate_coulomb_matrix()
119+
for comp in comps:
120+
comp.generate_coulomb_matrix()
119121

120-
training = comps[:1000]
122+
training = comps[:1000]
121123

122-
K = arad_kernel(training, training, sigma=100.0)
124+
K = arad_kernel(training, training, sigma=100.0)
125+
```
123126

124127
Additionally for ARAD, when the two sets of `Compound` are identical, it is possible to calculate only the upper triangle, which reduces the computational load by a factor of two.
125128

126-
from qml.kernels import arad_training_kernel
127-
K = arad_training_kernel(training, sigma=100.0)
128-
129+
```python
130+
from qml.kernels import arad_training_kernel
131+
K = arad_training_kernel(training, sigma=100.0)
132+
```
129133

130134
## 3.2) Calculate kernels using the `qml.kernels` module directly
131135

132136

133-
from qml.kernels import laplacian_kernel
137+
```python
138+
from qml.kernels import laplacian_kernel
139+
```
134140

135141
## 3.3) Benchmarks for QM7:
136142

0 commit comments

Comments
 (0)