量子计算入门
123import numpy as npfrom qiskit import QuantumCircuit, BasicAer, executefrom qiskit.visualization import plot_bloch_multivector, plot_histogram
量子比特(量子位)
量子比特的模型是二维复空间的向量。量子比特处在两个基态的叠加中,当观察量子比特时,总是会在两个基态中得到其中一个。
量子比特使用狄拉克符号表示为一个右矢的线性组合,即 α∣0⟩+β∣1⟩\alpha|0\rangle+\beta|1\rangleα∣0⟩+β∣1⟩;α\alphaα 和 β\betaβ 为两个基态上的振幅,必须满足归一化条件 ∣α∣2+∣β∣2=1|\alpha|^2+|\beta|^2=1∣α∣2+∣β∣2=1。
我们可以使用Qiskit创建一个量子比特,并用布洛赫球进行可视化。
12345678910111213141516# 振幅alpha = 1 / 2 + 1j / 4beta = 1 / 4 + np.sqrt(10) * 1j / 4# 创建只有一个量 ...
Invited: Drug Discovery Approaches using Quantum Machine Learning
Invited: Drug Discovery Approaches using Quantum Machine Learning | IEEE Conference Publication | IEEE Xplore
前置知识
阅读笔记–MolGAN: An implicit generative model for small molecular graphs_soccqy的博客-CSDN博客
《MolGAN: An implicit generative model for small molecular graphs》了解_NockinOnHeavensDoor的博客-CSDN博客
读后感
这是一篇描述性文字较多的文章。主要利用不同的QML模型进行药物研发,即优秀化合物生成的工作,并与经典模型作对比。由于神经网络这一方面目前了解较少,因此不能理解实验中各个细节其背后原理,也难以知晓其代码实现,还需继续学习。
摘要
传统的药物研发需要的时间和金钱消耗都很大。深层的生成和鉴别模型在药物研发中有广泛应用。文中提出了一套量子机器学习技术:结合生成对抗网络(GAN)、卷积神经网络(C ...
PS-Tree: A piecewise symbolic regression tree
PS-Tree: A piecewise symbolic regression tree - ScienceDirect
回归树可以将特征空间划分为几个子区域,为每个子区域建立一个响应模型(常数或线性模型);但是,当一些非线性结构出现时,回归树的表现并不好。文中提出了分段符号回归树(PS-Tree)。PS-Tree不使用常数值或线性模型作为叶节点,而是为叶节点或子区域构建符号回归量。此外,文中还提出了自适应的空间划分策略。将PS-Tree方法应用于122个合成数据集和真实数据集,结果表明,它的性能优于几种最先进的回归方法。
传统回归树本质上是连续分段函数,难以在自变量和因变量之间建立平滑的数量关系。
Regulating systemic crises: Stemming the contagion risk in networked-loans through deep graph learning
Regulating systemic crises: Stemming the contagion risk in networked-loans through deep graph learning | IEEE Journals & Magazine | IEEE Xplore
在网络借贷的过程中,如果借款公司毁约,担保公司具有向商业银行偿还债务的法律义务。在经济萧条时,违约的风险会向野火般燎原,借贷网络会扩大其覆盖面和影响力,以致大规模的毁约现象甚至系统性金融危机。为避免这一“灰犀牛”,中央银行正着力推动先进的监管技术。因此,我们提出了一个新颖的方法,以帮助监管者评估系统性风险,并在风险较小时进行扼杀。我们使用了目前最先进的图神经网络在全国的借贷网络中侦测和隔离风险的传播。该模型的总体精度达到91%以上的AUC,明显比基准方法表现好。当隔离风险最高的1%的结点后,毁约率显著降低了25。8%。此外,我们还进行了广泛的案例测试和用户调研,以评估方法的性能,结果也表名了其优越性。我们提出的方法打开了使用深度图学习技术估计借贷风险蔓延的新方向,使得决策者能针对系统性金融危机设 ...
Codeforces Global Round 9
A. Sign Flipping ↬\looparrowright↬
You are given nnn integers a1,a2,⋯ ,ana_1,a_2,\cdots,a_na1,a2,⋯,an, where nnn is odd. You are allowed to flip the sign of some (possibly all or none) of them. You wish to perform these flips in such a way that the following conditions hold:
At least n−12\frac{n−1}{2}2n−1 of the adjacent differences ai+1−aia_{i+1}−a_iai+1−ai for i=1,2,⋯ ,n−1i=1,2,\cdots,n−1i=1,2,⋯,n−1 are greater than or equal to 000.
At least n−12\frac{n−1}{2}2n−1 of the adjacent diffe ...
Spring
IoC
概念
IoC(控制反转,Inversion of Control),是面向对象编程中的一种设计原则,可以用来降低计算机代码之间的耦合度。通过控制反转,对象在被创建的时候,由一个调控系统内所有对象的外界实体将其所依赖的对象的引用传递给它;也可以说,依赖被注入到对象中。
属性注入
set方法注入属性
1234567891011121314151617package com.joe;import org.springframework.context.ApplicationContext;import org.springframework.context.support.ClassPathXmlApplicationContext;public class Book { private String name; private String author; public void setAuthor(String author) { this.author = author; } public void se ...
IDEA 启动异常
某天用IDEA打开项目,发现IDEA启动动画的进度条跑完,就一动不动了。
查看 C:\用户\用户名\AppData\Local\Jetbrains\IntelliJIdea\log\idea.log,错误信息如下。
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451462022-02-22 22:13:32,234 [ 0] INFO - #com.intelli ...
JavaWeb
代码仓库:自学尚硅谷JavaWeb2022版(JavaWeb-atguigu)
Servlet
继承关系
HttpServlet–>GenericServlet–>Servlet
service方法
当请求来到时,service方法会自动响应(实际上是Web容器Tomcat调用),在HttpServlet中会分析请求的方式(get、post、head、delete等),然后再决定调用哪个方法(doGet、doPost、doHead、doDelete),这些方法默认都是405响应,需要程序员继承HttpServlet并重写这些方法。
服务配置
在web.xml中配置,或者使用注解@WebServlet配置。
123456789<!-- 一个servlet对应多个servlet-mapping --><servlet> <servlet-name>Servlet名称</servlet-name> <servlet-class>Servlet类名</servlet-class></servlet&g ...
JDBC
简介
JDBC用于在Java程序中操作数据库。JDBC提供一套访问各类数据库通用的API,不同的数据库厂商会根据各自的数据库特点去实现这些接口。
以MySQL为例,需要导入对应版本的jar包才能使用JDBC,如mysql-connector-java-8.0.28.jar(下载)
基本步骤
加载驱动(Class.forName)
建立连接(DriverManager)并返回连接(Connection)
创建语句对象(Connection 创建一个 Statement 或 PreparedStatement , 用于执行SQL语句)
执行SQL语句(Statement 或 PreparedStatement执行SQL语句)
处理结果集(SELECT产生结果集ResultSet)
关闭连接(依次将ResultSet、Statement、PreparedStatement、Connection对象关闭,释放资源)
1234567891011121314151617181920212223242526272829303132333435import java.sql.*;/** * 我的 ...
MySQL数据管理
外键
如果公共关键字在一个关系中是主关键字,那么这个公共关键字被称为另一个关系的外键。由此可见,外键表示了两个关系之间的相关联系。以另一个关系的外键作主关键字的表被称为主表,具有此外键的表被称为主表的从表。外键又称作外关键字。
年级ID在年级表中是主键,在学生表中是外键。如果不使用外键,学生表的grade字段插入了一个值,但是这个值在年级表中并没有,这个时候,数据库允许插入,并不会对插入的数据做关系检查。然而在设置外键的情况下,插入学生表grade字段的值必须要求在年级表的ID字段能找到。 同时,如果要删除年级表的某个ID字段值,必须保证学生表中没有引用该字段值的列,否则就没法删除。这就是所谓的保持数据的一致性和完整性。
12345678910111213141516171819202122CREATE TABLE IF NOT EXISTS `grade`( `id` INT NOT NULL AUTO_INCREMENT COMMENT '年级id', `name` VARCHAR(50) NOT NULL COMMENT '年级名称', P ...