Skip to content

Commit

Permalink
more renaming, doc adjustments etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
phfaist committed Jul 5, 2018
1 parent 071ec04 commit a4d08be
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 36 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ message(WARNING "
> python setup.py install
Check out the README file for more information.
Check out the README.md file for more information.
============================================================================
")

Expand All @@ -33,7 +33,7 @@ find_package(Boost COMPONENTS unit_test_framework REQUIRED)

find_package(Threads REQUIRED)

find_package(TomographerPy 5.3 REQUIRED)
find_package(TomographerPy 5.4 REQUIRED)


include_directories(${SCS_INCLUDE_DIRS})
Expand Down
4 changes: 2 additions & 2 deletions QPtomographer/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ def simulate_process_prep_measure(E_AB, prep_meas_settings):
`num_repeats` is the number of times to repeat this setting.
Returns: an object `d` with properties `d.Emn_ch`, `d.Nm`, representing the
arguments suitable for `QPtomographer.channelspace.run()` and the simulated
frequency counts.
arguments suitable for :py:meth:`QPtomographer.channelspace.run()` and the
simulated frequency counts.
"""

Emn_ch = []
Expand Down
12 changes: 6 additions & 6 deletions cxx/channelspace.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ struct ChannelTypes : public Tomographer::DenseDM::DMTypes<Eigen::Dynamic,Scalar
typedef Eigen::Matrix<ComplexScalar, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor> VIsometryType;

private:
std::size_t dim_x;
std::size_t dim_y;
Eigen::Index dim_x;
Eigen::Index dim_y;

public:
ChannelTypes(std::size_t dim_x_, std::size_t dim_y_)
ChannelTypes(Eigen::Index dim_x_, Eigen::Index dim_y_)
: Base(dim_x_*dim_y_), dim_x(dim_x_), dim_y(dim_y_)
{
}

inline std::size_t dimX() const { return dim_x; }
inline std::size_t dimY() const { return dim_y; }
inline std::size_t dimXY2() const { return Base::dim()*dim_y; }
inline Eigen::Index dimX() const { return dim_x; }
inline Eigen::Index dimY() const { return dim_y; }
inline Eigen::Index dimXY2() const { return Base::dim()*dim_y; }

};

Expand Down
28 changes: 15 additions & 13 deletions cxx/worstentglfidelity_figofmerit.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ class WorstEntglFidelitySCSSolver
const scs_int dvmu = 1;
const scs_int dvzRdiag = DimX;
const scs_int dvzRtri = DimX*(DimX-1)/2;
const scs_int dvzItri = dvzRtri; // == DimX*(DimX-1)/2;
//const scs_int dvzItri = dvzRtri; // == DimX*(DimX-1)/2;

const scs_int var_mu_offset = 0;
const scs_int var_zRdiag_offset = var_mu_offset + dvmu;
Expand Down Expand Up @@ -333,7 +333,7 @@ class WorstEntglFidelitySCSSolver
// ** number of columns = 1 + DimX*DimX = # of variable degrees of freedom
// == 1 + dzR + dzI (dzR = DimX*(DimX+1)/2 , dzI = DimX*(DimX-1)/2)

scs_int i, j, ip, jp, ij, k;
scs_int i, ip, jp, ij, k;
scs_int trivarno;

logger.longdebug([&](std::ostream & stream) {
Expand Down Expand Up @@ -573,8 +573,8 @@ class WorstEntglFidelitySCSSolver

std::vector<std::vector<std::string> > fmtall;
fmtall.resize(Amat.rows());
int w = 0;
int i, j;
std::size_t w = 0;
Eigen::Index i, j;
for (i = 0; i < Amat.rows(); ++i) {
fmtall[i].resize(Amat.cols());
for (j = 0; j < Amat.cols(); ++j) {
Expand All @@ -592,7 +592,9 @@ class WorstEntglFidelitySCSSolver
fmtall.insert(fmtall.begin(), std::vector<std::string>());
fmtall[0].resize(1+DimX*DimX);
fmtall[0][0] = "mu ";
for (i = 0; i < DimX; ++i) { fmtall[0][1+i] = "rhoR("+std::to_string(i)+","+std::to_string(i)+") "; }
for (i = 0; i < DimX; ++i) {
fmtall[0][1+i] = "rhoR("+std::to_string(i)+","+std::to_string(i)+") ";
}
int varcount = 0;
for (j = 0; j < DimX; ++j) {
for (i = j+1; i < DimX; ++i) {
Expand All @@ -603,9 +605,9 @@ class WorstEntglFidelitySCSSolver

std::vector<std::string> lines;
lines.resize(fmtall.size());
for (i = 0; i < fmtall.size(); ++i) {
for (i = 0; i < (Eigen::Index)fmtall.size(); ++i) {
lines[i] = std::string();
for (j = 0; j < fmtall[i].size(); ++j) {
for (j = 0; j < (Eigen::Index)fmtall[i].size(); ++j) {
lines[i] += std::string(w - fmtall[i][j].size(), ' ') + fmtall[i][j];
}
}
Expand All @@ -616,13 +618,13 @@ class WorstEntglFidelitySCSSolver
const scs_int dC1 = 2*DimX;
const scs_int dC2 = 2*(1+DimXX);
// # of degrees of freedom of each constraint block (== number of corresponding rows in A)
const scs_int dC0x = 1;
const scs_int dC1x = dC1*(dC1+1)/2;
const scs_int dC2x = dC2*(dC2+1)/2;
//const scs_int dC0x = 1;
//const scs_int dC1x = dC1*(dC1+1)/2;
//const scs_int dC2x = dC2*(dC2+1)/2;
// offset for each constraint number
const scs_int con_offset_0 = 0;
const scs_int con_offset_1 = con_offset_0+dC0x;
const scs_int con_offset_2 = con_offset_1+dC1x;
//const scs_int con_offset_0 = 0;
//const scs_int con_offset_1 = con_offset_0+dC0x;
//const scs_int con_offset_2 = con_offset_1+dC1x;

// the labels come first

Expand Down
71 changes: 62 additions & 9 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,33 +1,68 @@

@import url('https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400i,600,600i');
@import url('https://fonts.googleapis.com/css?family=PT+Serif:400,400i,700,700i|Roboto:300,400,400i,500');

body {
font-weight: 400;
}

a, a:hover {
text-decoration: none;
}

.logo {
padding-bottom: 0.75em;
}
div.sphinxsidebar .logo a {
border-bottom: none 0px;
}
.sphinxsidebar .toctree-l1 {
padding-bottom: 0.5em;
list-style: disc;
}
div.sphinxsidebarwrapper .caption-text {
display: none;
}

div.body h1 {
margin-bottom: 0.5em;
}
div.body h2 {
margin-bottom: 0.5em;
}
#indices-and-tables {
margin-top: 2.5em;
}

pre {
background-color: inherit;
border-left: solid 1em rgba(0,0,80,0.1);
padding: 5px 1.5em;
}
dl pre, blockquote pre, li pre {
padding-left: 1.3em;
}
pre, tt, code {
font-weight: 400;
}
code.xref, a code {
font-weight: 500;
/*color: rgba(0, 65, 114, 1.0);*/
border-bottom: 1px dotted #004B6B;
}
tt.descname, code.descname {
padding: 0px;
font-weight: 500;
}
tt.descclassname, code.descclassname {
padding: 0px;
font-weight: 300;
}

pre, tt, code {
background-color: rgba(0,0,80,0.06);
}
tt, code {
padding: 1px 2px;
}


div.section > dl > dt {
Expand All @@ -36,17 +71,35 @@ div.section > dl > dt {
border-top: solid 0.25em rgba(0,40,70,0.5);
}

div.important {
background-color: rgba(255,207,0,0.15);
border: 1px solid rgba(255,207,0,0.5);
}


.sphinxsidebar .toctree-l1 {
padding-bottom: 0.5em;
list-style: disc;
div.genindex-jumpbox {
font-family: "Roboto", sans-serif;
font-weight: 500;
border: solid 0.5px rgba(62, 67, 73, 0.4);
}

.genindextable {
font-size: 0.8em;
div.genindex-jumpbox a {
text-decoration: none;
display: inline-block;
padding: 2px;
}
div.body .genindextable {
font-size: 0.9em;
}
#index ~ h2 {
font-size: 1.3em;
font-weight: 500;
margin: 0.5em 0px 0px;
border-bottom: solid 0.5px rgba(62, 67, 73, 0.4);
}
.genindextable ul {
text-indent: -1.2em;
margin-left: 1.2em;
}


/* @media screen and (max-width: 870px) { */
.docutils.field-list > tbody > tr > th.field-name {
Expand Down
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

# General information about the project.
project = 'Practical and reliable process tomography'
copyright = '2017, Philippe Faist'
copyright = '2018, Philippe Faist'
author = 'Philippe Faist'

# The version info for the project you're documenting, acts as replacement for
Expand Down Expand Up @@ -100,10 +100,10 @@
# documentation.
#
html_theme_options = {
'font_family': '"Source Sans Pro", sans-serif',
'font_family': '"PT Serif", sans-serif',
'font_size': '16px',
'head_font_family': '"Source Sans Pro", sans-serif',
'code_font_family': '"Source Sans Pro", monospace',
'head_font_family': '"Roboto", sans-serif',
'code_font_family': '"Roboto", monospace',
'code_font_size': '0.9em',
}

Expand Down

0 comments on commit a4d08be

Please sign in to comment.